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
path: root/src
diff options
context:
space:
mode:
authorSteve Pfister <steveisok@users.noreply.github.com>2019-10-14 16:37:02 +0300
committerGitHub <noreply@github.com>2019-10-14 16:37:02 +0300
commit8e3b279377d1f01d2d089f24548e33855bf6502e (patch)
treef51979b0d42788c62d4f626c0111e2267b207a9b /src
parent49b4ece74b1401a70a626f8b9d211cbc382b238a (diff)
Modifies the RequestUri property on HttpRequestMessage to validate the same way as the constructor does. (#361)
It will now call into IsAllowedAbsoluteUri, which adds some mono specific checks.
Diffstat (limited to 'src')
-rw-r--r--src/System.Net.Http/src/System/Net/Http/HttpRequestMessage.cs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/System.Net.Http/src/System/Net/Http/HttpRequestMessage.cs b/src/System.Net.Http/src/System/Net/Http/HttpRequestMessage.cs
index ae3ab2826d..0201694701 100644
--- a/src/System.Net.Http/src/System/Net/Http/HttpRequestMessage.cs
+++ b/src/System.Net.Http/src/System/Net/Http/HttpRequestMessage.cs
@@ -81,15 +81,23 @@ namespace System.Net.Http
}
}
+
public Uri RequestUri
{
get { return _requestUri; }
set
{
+#if MONO
+ if ((value != null) && (!IsAllowedAbsoluteUri(value)))
+ {
+ throw new ArgumentException(SR.net_http_client_http_baseaddress_required, nameof(value));
+ }
+#else
if ((value != null) && (value.IsAbsoluteUri) && (!HttpUtilities.IsHttpUri(value)))
{
throw new ArgumentException(SR.net_http_client_http_baseaddress_required, nameof(value));
}
+#endif
CheckDisposed();
// It's OK to set 'null'. HttpClient will add the 'BaseAddress'. If there is no 'BaseAddress'