From 102bbe2beb76fa76b21f4ed3f7c584a58d787204 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 12 Nov 2016 17:46:38 -0500 Subject: fix mono project --- SocketHttpListener.Portable/Net/HttpListenerRequest.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'SocketHttpListener.Portable/Net/HttpListenerRequest.cs') diff --git a/SocketHttpListener.Portable/Net/HttpListenerRequest.cs b/SocketHttpListener.Portable/Net/HttpListenerRequest.cs index 5631fc0a1..767f1c542 100644 --- a/SocketHttpListener.Portable/Net/HttpListenerRequest.cs +++ b/SocketHttpListener.Portable/Net/HttpListenerRequest.cs @@ -179,16 +179,21 @@ namespace SocketHttpListener.Net } } - if (String.Compare(Headers["Expect"], "100-continue", StringComparison.OrdinalIgnoreCase) == 0) + if (HasExpect100Continue) { - var output = context.Connection.GetResponseStream(); - + var output = (ResponseStream)context.Connection.GetResponseStream(this); + var _100continue = _textEncoding.GetASCIIEncoding().GetBytes("HTTP/1.1 100 Continue\r\n\r\n"); - //output.InternalWrite(_100continue, 0, _100continue.Length); + output.InternalWrite(_100continue, 0, _100continue.Length); } } + public bool HasExpect100Continue + { + get { return String.Compare(Headers["Expect"], "100-continue", StringComparison.OrdinalIgnoreCase) == 0; } + } + static bool MaybeUri(string s) { int p = s.IndexOf(':'); -- cgit v1.2.3