Commit 275ebf64 authored by Honfika's avatar Honfika

fix for #303 + removed unused usings

parent 8edbc4a2
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
using System.IO; using System.IO;
using System.IO.Compression; using System.IO.Compression;
using System.Threading.Tasks; using System.Threading.Tasks;
using Titanium.Web.Proxy.Helpers;
namespace Titanium.Web.Proxy.Decompression namespace Titanium.Web.Proxy.Decompression
{ {
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
using System.IO; using System.IO;
using System.IO.Compression; using System.IO.Compression;
using System.Threading.Tasks; using System.Threading.Tasks;
using Titanium.Web.Proxy.Helpers;
namespace Titanium.Web.Proxy.Decompression namespace Titanium.Web.Proxy.Decompression
{ {
......
...@@ -3,7 +3,6 @@ using System; ...@@ -3,7 +3,6 @@ using System;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.Threading.Tasks; using System.Threading.Tasks;
using Titanium.Web.Proxy.Helpers;
namespace Titanium.Web.Proxy.Extensions namespace Titanium.Web.Proxy.Extensions
{ {
......
using StreamExtended.Network; using StreamExtended.Network;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Titanium.Web.Proxy.Helpers;
using Titanium.Web.Proxy.Models; using Titanium.Web.Proxy.Models;
using Titanium.Web.Proxy.Shared; using Titanium.Web.Proxy.Shared;
......
...@@ -79,10 +79,20 @@ namespace Titanium.Web.Proxy.Http ...@@ -79,10 +79,20 @@ namespace Titanium.Web.Proxy.Http
using (var ms = new MemoryStream()) using (var ms = new MemoryStream())
using (var writer = new HttpRequestWriter(ms)) using (var writer = new HttpRequestWriter(ms))
{ {
var upstreamProxy = ServerConnection.UpStreamHttpProxy;
bool useUpstreamProxy = upstreamProxy != null && ServerConnection.IsHttps == false;
//prepare the request & headers //prepare the request & headers
if (useUpstreamProxy)
{
writer.WriteLine($"{Request.Method} {Request.OriginalRequestUrl} HTTP/{Request.HttpVersion.Major}.{Request.HttpVersion.Minor}");
}
else
{
writer.WriteLine($"{Request.Method} {Request.RequestUri.PathAndQuery} HTTP/{Request.HttpVersion.Major}.{Request.HttpVersion.Minor}"); writer.WriteLine($"{Request.Method} {Request.RequestUri.PathAndQuery} HTTP/{Request.HttpVersion.Major}.{Request.HttpVersion.Minor}");
}
var upstreamProxy = ServerConnection.UpStreamHttpProxy;
//Send Authentication to Upstream proxy if needed //Send Authentication to Upstream proxy if needed
if (upstreamProxy != null if (upstreamProxy != null
......
using StreamExtended.Network; using StreamExtended.Network;
using System; using System;
using System.IO;
using System.Linq; using System.Linq;
using System.Net.Security; using System.Net.Security;
using System.Net.Sockets; using System.Net.Sockets;
......
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