Bug 28603 - HttpClient adds comma in user-agent
Summary: HttpClient adds comma in user-agent
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Net.Http ()
Version: 3.12.0
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2015-03-31 14:57 UTC by Stephane Delcroix
Modified: 2015-03-31 15:02 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Stephane Delcroix 2015-03-31 14:57:34 UTC
I'm adding a user-agent to my HttpClient like this

    client.DefaultRequestHeaders.Add ("User-Agent", "MyApp/ (iOS; 7.1.2; fr_FR) (Apple;iPhone3,1)");

but the string sent on the wire look like this

    "MyApp/, (iOS; 7.1.2; fr_FR), (Apple;iPhone3,1)"

(look at the commas)

IMHO, this comes from https://github.com/mono/mono/blob/effa4c07ba850bedbe1ff54b2a5df281c058ebcb/mcs/class/System.Net.Http/System.Net.Http.Headers/HttpHeaderValueCollection.cs#L100
Comment 1 Stephane Delcroix 2015-03-31 15:02:49 UTC
mmm, I'm probably reporting this to the wrong place, I just figured I'm using System.Net.Http from nuget...