Commit a08acc1b authored by justcoding121's avatar justcoding121 Committed by justcoding121

Revert "issue #2 fix"

This reverts commit 1207f21a.
parent dfe252ca
...@@ -41,7 +41,6 @@ namespace Titanium.HTTPProxyServer ...@@ -41,7 +41,6 @@ namespace Titanium.HTTPProxyServer
header = s; header = s;
value = response.Headers[s]; value = response.Headers[s];
} }
else else
returnHeaders.Add(new Tuple<String, String>(s, response.Headers[s])); returnHeaders.Add(new Tuple<String, String>(s, response.Headers[s]));
} }
...@@ -54,11 +53,7 @@ namespace Titanium.HTTPProxyServer ...@@ -54,11 +53,7 @@ namespace Titanium.HTTPProxyServer
returnHeaders.Add(new Tuple<String, String>("Set-Cookie", cookie)); returnHeaders.Add(new Tuple<String, String>("Set-Cookie", cookie));
} }
if (returnHeaders.Any(x => x.Item1.ToLower().Equals("www-authenticate")))
{
if (returnHeaders.Any(x => x.Item1.ToLower().Equals("www-authenticate") == false && x.Item2.ToLower().Equals("basic") == false))
returnHeaders.Add(new Tuple<String, String>("WWW-Authenticate", "Basic"));
}
return returnHeaders; return returnHeaders;
} }
...@@ -136,13 +131,13 @@ namespace Titanium.HTTPProxyServer ...@@ -136,13 +131,13 @@ namespace Titanium.HTTPProxyServer
{ {
for (int i = 1; i < requestLines.Count; i++) for(int i=1; i<requestLines.Count; i++)
{ {
String httpCmd = requestLines[i]; String httpCmd = requestLines[i];
String[] header = httpCmd.Split(colonSpaceSplit, 2, StringSplitOptions.None); String[] header = httpCmd.Split(colonSpaceSplit, 2, StringSplitOptions.None);
if (!String.IsNullOrEmpty(header[0].Trim())) if(!String.IsNullOrEmpty(header[0].Trim()))
switch (header[0].ToLower()) switch (header[0].ToLower())
{ {
case "accept": case "accept":
...@@ -209,7 +204,7 @@ namespace Titanium.HTTPProxyServer ...@@ -209,7 +204,7 @@ namespace Titanium.HTTPProxyServer
break; break;
default: default:
if (header.Length > 0) if(header.Length>0)
webReq.Headers.Add(header[0], header[1]); webReq.Headers.Add(header[0], header[1]);
else else
webReq.Headers.Add(header[0], ""); webReq.Headers.Add(header[0], "");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment