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:
authorSteve Pfister <steveisok@users.noreply.github.com>2019-08-26 17:27:25 +0300
committerAlexander Köplinger <alex.koeplinger@outlook.com>2019-08-26 17:27:25 +0300
commit4b5651696b71eea9bb81a9ede5f4d7c394c4d2c9 (patch)
tree912c3ef20044f168e2416189a9d4b97b03f6dec7
parent33308c540f2a06d11f555a80244728941f09f628 (diff)
Allow file:// uri's to be provided to HttpClient (#339)
The Uri will eventually be combined w/ a base address and will eventually make a proper one. This restores mono's old Uri + HttpClient behavior, added originally by https://github.com/mono/mono/commit/0b7afa989dafd4d712d5a94044fd98ecc40f2ecc The issue was logged from: https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems/edit/967582 It appears that the test that would have caught this was disabled via this commit: https://github.com/mono/mono/commit/2f411750acfd2132f9b4970ef8cf11d9a0f62df9
-rw-r--r--src/System.Net.Http/src/System/Net/Http/HttpClient.cs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/System.Net.Http/src/System/Net/Http/HttpClient.cs b/src/System.Net.Http/src/System/Net/Http/HttpClient.cs
index aa69194a9f..7203d9c397 100644
--- a/src/System.Net.Http/src/System/Net/Http/HttpClient.cs
+++ b/src/System.Net.Http/src/System/Net/Http/HttpClient.cs
@@ -666,8 +666,12 @@ namespace System.Net.Http
}
else
{
+#if MONO
+ if (!request.RequestUri.IsAbsoluteUri || request.RequestUri.Scheme == Uri.UriSchemeFile && request.RequestUri.OriginalString.StartsWith ("/", StringComparison.Ordinal)))
+#else
// If the request Uri is an absolute Uri, just use it. Otherwise try to combine it with the base Uri.
if (!request.RequestUri.IsAbsoluteUri)
+#endif
{
if (_baseAddress == null)
{