Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corefx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Baulig <mabaul@microsoft.com>2019-12-02 19:42:59 +0300
committerMartin Baulig <mabaul@microsoft.com>2019-12-03 16:45:04 +0300
commit55a2ec2613194859680f22517cd707a8dc0f932c (patch)
treeeba8472d2b671d7c579b3c40ca333a8a102c9d40
parent1cdb9c20946c74a88a7fa507215556fadc2c2b27 (diff)
[System.Net.Http]: Add workaround for mono/mono#17897.
Use `(UriKind)300` (which is the same as setting `MONO_URI_DOTNETRELATIVEORABSOLUTE=true`) when parsing Uri headers.
-rw-r--r--src/System.Net.Http/src/System/Net/Http/Headers/UriHeaderParser.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/System.Net.Http/src/System/Net/Http/Headers/UriHeaderParser.cs b/src/System.Net.Http/src/System/Net/Http/Headers/UriHeaderParser.cs
index a2d483f9ff..7c0444efc4 100644
--- a/src/System.Net.Http/src/System/Net/Http/Headers/UriHeaderParser.cs
+++ b/src/System.Net.Http/src/System/Net/Http/Headers/UriHeaderParser.cs
@@ -13,8 +13,17 @@ namespace System.Net.Http.Headers
{
private UriKind _uriKind;
+#if MONO
+ // FIXME: Workaround for https://github.com/mono/mono/issues/17897.
+ // This is the same as setting the MONO_URI_DOTNETRELATIVEORABSOLUTE=true
+ // environment variable.
+ // See https://github.com/mono/mono/blob/1454b010ae1165a0f2cf261b9420e32d1b52fdaf/mcs/class/referencesource/System/net/System/URI.cs#L991.
+ internal static readonly UriHeaderParser RelativeOrAbsoluteUriParser =
+ new UriHeaderParser((UriKind)300);
+#else
internal static readonly UriHeaderParser RelativeOrAbsoluteUriParser =
new UriHeaderParser(UriKind.RelativeOrAbsolute);
+#endif
private UriHeaderParser(UriKind uriKind)
: base(false)