[Modify] Polish it
This commit is contained in:
parent
9a9b3e43bd
commit
605ae9173e
@ -692,17 +692,21 @@ namespace WebSocketSharp.Net
|
|||||||
{
|
{
|
||||||
if (_protocolVersion == HttpVersion.Version10) {
|
if (_protocolVersion == HttpVersion.Version10) {
|
||||||
finishInitialization10 ();
|
finishInitialization10 ();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_userHostName == null) {
|
if (_userHostName == null) {
|
||||||
_context.ErrorMessage = "Host header required";
|
_context.ErrorMessage = "Host header required";
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var transferEnc = _headers["Transfer-Encoding"];
|
var transferEnc = _headers["Transfer-Encoding"];
|
||||||
|
|
||||||
if (transferEnc != null) {
|
if (transferEnc != null) {
|
||||||
var comparison = StringComparison.OrdinalIgnoreCase;
|
var comparison = StringComparison.OrdinalIgnoreCase;
|
||||||
|
|
||||||
if (!transferEnc.Equals ("chunked", comparison)) {
|
if (!transferEnc.Equals ("chunked", comparison)) {
|
||||||
_context.ErrorMessage = String.Empty;
|
_context.ErrorMessage = String.Empty;
|
||||||
_context.ErrorStatusCode = 501;
|
_context.ErrorStatusCode = 501;
|
||||||
@ -723,10 +727,13 @@ namespace WebSocketSharp.Net
|
|||||||
}
|
}
|
||||||
|
|
||||||
var expect = _headers["Expect"];
|
var expect = _headers["Expect"];
|
||||||
|
|
||||||
if (expect != null) {
|
if (expect != null) {
|
||||||
var comparison = StringComparison.OrdinalIgnoreCase;
|
var comparison = StringComparison.OrdinalIgnoreCase;
|
||||||
|
|
||||||
if (!expect.Equals ("100-continue", comparison)) {
|
if (!expect.Equals ("100-continue", comparison)) {
|
||||||
_context.ErrorMessage = "Invalid Expect header";
|
_context.ErrorMessage = "Invalid Expect header";
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user