提交 f4c13c06 编写于 作者: G Gonzalo Paniagua Javier

Allow forcing HTTP protocol version

	If the version is manually set, ignore the version from the service
	point when set.

	Fixes bug #668199.
上级 3d2caadf
......@@ -76,6 +76,7 @@ namespace System.Net
bool preAuthenticate;
bool usedPreAuth;
Version version = HttpVersion.Version11;
bool force_version;
Version actualVersion;
IWebProxy proxy;
bool sendChunked;
......@@ -517,6 +518,7 @@ namespace System.Net
if (value != HttpVersion.Version10 && value != HttpVersion.Version11)
throw new ArgumentException ("value");
force_version = true;
version = value;
}
}
......@@ -1191,7 +1193,7 @@ namespace System.Net
actualUri.PathAndQuery);
}
if (servicePoint.ProtocolVersion != null && servicePoint.ProtocolVersion < version) {
if (!force_version && servicePoint.ProtocolVersion != null && servicePoint.ProtocolVersion < version) {
actualVersion = servicePoint.ProtocolVersion;
} else {
actualVersion = version;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册