Bug 27036

Summary: Adding the user-agent header to HttpClient object throws a System.FormatException: Invalid format.
Product: [Mono] Class Libraries Reporter: Prashant Cholachagudda <prchol>
Component: System.Net.HttpAssignee: Marek Safar <masafa>
Status: RESOLVED FIXED    
Severity: normal CC: masafa, mono-bugs+mono, norman.mackay
Priority: ---    
Version: 3.12.0   
Target Milestone: Untriaged   
Hardware: PC   
OS: Mac OS   
Tags: Is this bug a regression?: ---
Last known good build:

Description Prashant Cholachagudda 2015-02-13 05:28:46 UTC
Adding the user-agent header to HttpClient object throws a System.FormatException: Invalid format.

Stacktrace:

System.FormatException: Invalid format.
  at System.Net.Http.Headers.HttpHeaders.AddInternal (System.String name, IEnumerable`1 values, System.Net.Http.Headers.HeaderInfo headerInfo, Boolean ignoreInvalid) [0x00000] in <filename unknown>:0 
  at System.Net.Http.Headers.HttpHeaders.Add (System.String name, IEnumerable`1 values) [0x00000] in <filename unknown>:0 
  at System.Net.Http.Headers.HttpHeaders.Add (System.String name, System.String value) [0x00000] in <filename unknown>:0 
  at Data.Services.PersonService+<CreateSession>c__async0.MoveNext () [0x000ac] in /Users/prashantvc/Desktop items/Xamarin/124040/Xamarin-HTTPS Issue in Sim/Xamarin/Data/Services/PersonService.cs:52 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
  at System.Runtime.CompilerServices.TaskAwaiter`1[Data.Model.VResponse].GetResult () [0x00000] in <filename unknown>:0 
  at Data.ViewModel.LoginViewModel+<>c__async1.MoveNext () [0x00102] in /Users/prashantvc/Desktop items/Xamarin/124040/Xamarin-HTTPS Issue in Sim/Xamarin/Data/ViewModel/LoginViewModel.cs:55 

Test case: https://gist.github.com/prashantvc/d6e8cab1e242b9c22d64
Comment 1 Marek Safar 2015-02-13 08:37:55 UTC
Fixed in master