Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
Titanium-Web-Proxy
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Titanium-Web-Proxy
Commits
f560e29f
Unverified
Commit
f560e29f
authored
Feb 06, 2018
by
honfika
Committed by
GitHub
Feb 06, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #366 from justcoding121/develop
Request Url fix
parents
603223a7
d154f42d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
4 deletions
+19
-4
RequestHandler.cs
Titanium.Web.Proxy/RequestHandler.cs
+19
-4
No files found.
Titanium.Web.Proxy/RequestHandler.cs
View file @
f560e29f
...
@@ -5,6 +5,7 @@ using System.Net;
...
@@ -5,6 +5,7 @@ using System.Net;
using
System.Net.Security
;
using
System.Net.Security
;
using
System.Net.Sockets
;
using
System.Net.Sockets
;
using
System.Security.Authentication
;
using
System.Security.Authentication
;
using
System.Text.RegularExpressions
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
StreamExtended
;
using
StreamExtended
;
using
StreamExtended.Helpers
;
using
StreamExtended.Helpers
;
...
@@ -15,7 +16,6 @@ using Titanium.Web.Proxy.Extensions;
...
@@ -15,7 +16,6 @@ using Titanium.Web.Proxy.Extensions;
using
Titanium.Web.Proxy.Helpers
;
using
Titanium.Web.Proxy.Helpers
;
using
Titanium.Web.Proxy.Http
;
using
Titanium.Web.Proxy.Http
;
using
Titanium.Web.Proxy.Models
;
using
Titanium.Web.Proxy.Models
;
using
Titanium.Web.Proxy.Network
;
using
Titanium.Web.Proxy.Network.Tcp
;
using
Titanium.Web.Proxy.Network.Tcp
;
namespace
Titanium.Web.Proxy
namespace
Titanium.Web.Proxy
...
@@ -25,6 +25,8 @@ namespace Titanium.Web.Proxy
...
@@ -25,6 +25,8 @@ namespace Titanium.Web.Proxy
/// </summary>
/// </summary>
partial
class
ProxyServer
partial
class
ProxyServer
{
{
private
static
readonly
Regex
uriSchemeRegex
=
new
Regex
(
"^[a-z]*://"
,
RegexOptions
.
IgnoreCase
|
RegexOptions
.
Compiled
);
private
bool
isWindowsAuthenticationEnabledAndSupported
=>
EnableWinAuth
&&
RunTime
.
IsWindows
&&
!
RunTime
.
IsRunningOnMono
;
private
bool
isWindowsAuthenticationEnabledAndSupported
=>
EnableWinAuth
&&
RunTime
.
IsWindows
&&
!
RunTime
.
IsRunningOnMono
;
/// <summary>
/// <summary>
...
@@ -360,9 +362,22 @@ namespace Titanium.Web.Proxy
...
@@ -360,9 +362,22 @@ namespace Titanium.Web.Proxy
//Read the request headers in to unique and non-unique header collections
//Read the request headers in to unique and non-unique header collections
await
HeaderParser
.
ReadHeaders
(
clientStreamReader
,
args
.
WebSession
.
Request
.
Headers
);
await
HeaderParser
.
ReadHeaders
(
clientStreamReader
,
args
.
WebSession
.
Request
.
Headers
);
var
httpRemoteUri
=
new
Uri
(
httpsConnectHostname
==
null
Uri
httpRemoteUri
;
?
isTransparentEndPoint
?
string
.
Concat
(
"http://"
,
args
.
WebSession
.
Request
.
Host
,
httpUrl
)
:
httpUrl
if
(
uriSchemeRegex
.
IsMatch
(
httpUrl
))
:
string
.
Concat
(
"https://"
,
args
.
WebSession
.
Request
.
Host
??
httpsConnectHostname
,
httpUrl
));
{
httpRemoteUri
=
new
Uri
(
httpUrl
);
}
else
{
string
host
=
args
.
WebSession
.
Request
.
Host
??
httpsConnectHostname
;
string
hostAndPath
=
host
;
if
(
httpUrl
.
StartsWith
(
"/"
))
{
hostAndPath
+=
httpUrl
;
}
httpRemoteUri
=
new
Uri
(
string
.
Concat
(
httpsConnectHostname
==
null
?
"http://"
:
"https://"
,
hostAndPath
));
}
args
.
WebSession
.
Request
.
RequestUri
=
httpRemoteUri
;
args
.
WebSession
.
Request
.
RequestUri
=
httpRemoteUri
;
args
.
WebSession
.
Request
.
OriginalUrl
=
httpUrl
;
args
.
WebSession
.
Request
.
OriginalUrl
=
httpUrl
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment