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
12e910fe
Commit
12e910fe
authored
May 26, 2017
by
justcoding121
Committed by
justcoding121
May 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix WinAuth issue when request body is not read
parent
ace7c729
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
3 deletions
+18
-3
ProxyTestController.cs
.../Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs
+1
-2
Request.cs
Titanium.Web.Proxy/Http/Request.cs
+5
-0
RequestHandler.cs
Titanium.Web.Proxy/RequestHandler.cs
+10
-0
WinAuthHandler.cs
Titanium.Web.Proxy/WinAuthHandler.cs
+2
-1
No files found.
Examples/Titanium.Web.Proxy.Examples.Basic/ProxyTestController.cs
View file @
12e910fe
...
@@ -116,8 +116,7 @@ namespace Titanium.Web.Proxy.Examples.Basic
...
@@ -116,8 +116,7 @@ namespace Titanium.Web.Proxy.Examples.Basic
//read request headers
//read request headers
var
requestHeaders
=
e
.
WebSession
.
Request
.
RequestHeaders
;
var
requestHeaders
=
e
.
WebSession
.
Request
.
RequestHeaders
;
var
method
=
e
.
WebSession
.
Request
.
Method
.
ToUpper
();
if
(
e
.
WebSession
.
Request
.
HasBody
)
if
(
method
==
"POST"
||
method
==
"PUT"
||
method
==
"PATCH"
)
{
{
//Get/Set request body bytes
//Get/Set request body bytes
byte
[]
bodyBytes
=
await
e
.
GetRequestBody
();
byte
[]
bodyBytes
=
await
e
.
GetRequestBody
();
...
...
Titanium.Web.Proxy/Http/Request.cs
View file @
12e910fe
...
@@ -26,6 +26,11 @@ namespace Titanium.Web.Proxy.Http
...
@@ -26,6 +26,11 @@ namespace Titanium.Web.Proxy.Http
/// </summary>
/// </summary>
public
Version
HttpVersion
{
get
;
set
;
}
public
Version
HttpVersion
{
get
;
set
;
}
/// <summary>
/// Has request body?
/// </summary>
public
bool
HasBody
=>
Method
==
"POST"
||
Method
==
"PUT"
||
Method
==
"PATCH"
;
/// <summary>
/// <summary>
/// Request Http hostanem
/// Request Http hostanem
/// </summary>
/// </summary>
...
...
Titanium.Web.Proxy/RequestHandler.cs
View file @
12e910fe
...
@@ -322,6 +322,16 @@ namespace Titanium.Web.Proxy
...
@@ -322,6 +322,16 @@ namespace Titanium.Web.Proxy
PrepareRequestHeaders
(
args
.
WebSession
.
Request
.
RequestHeaders
,
args
.
WebSession
);
PrepareRequestHeaders
(
args
.
WebSession
.
Request
.
RequestHeaders
,
args
.
WebSession
);
args
.
WebSession
.
Request
.
Host
=
args
.
WebSession
.
Request
.
RequestUri
.
Authority
;
args
.
WebSession
.
Request
.
Host
=
args
.
WebSession
.
Request
.
RequestUri
.
Authority
;
//if win auth is enabled
//we need a cache of request body
//so that we can send it after authentication in WinAuthHandler.cs
if
(
EnableWinAuth
&&
!
RunTime
.
IsRunningOnMono
()
&&
args
.
WebSession
.
Request
.
HasBody
)
{
await
args
.
GetRequestBody
();
}
//If user requested interception do it
//If user requested interception do it
if
(
BeforeRequest
!=
null
)
if
(
BeforeRequest
!=
null
)
{
{
...
...
Titanium.Web.Proxy/WinAuthHandler.cs
View file @
12e910fe
...
@@ -96,7 +96,8 @@ namespace Titanium.Web.Proxy
...
@@ -96,7 +96,8 @@ namespace Titanium.Web.Proxy
//challenge value will start with any of the scheme selected
//challenge value will start with any of the scheme selected
else
else
{
{
scheme
=
authSchemes
.
FirstOrDefault
(
x
=>
authHeader
.
Value
.
StartsWith
(
x
,
StringComparison
.
OrdinalIgnoreCase
));
scheme
=
authSchemes
.
FirstOrDefault
(
x
=>
authHeader
.
Value
.
StartsWith
(
x
,
StringComparison
.
OrdinalIgnoreCase
)
&&
authHeader
.
Value
.
Length
>
x
.
Length
+
1
);
var
serverToken
=
authHeader
.
Value
.
Substring
(
scheme
.
Length
+
1
);
var
serverToken
=
authHeader
.
Value
.
Substring
(
scheme
.
Length
+
1
);
var
clientToken
=
WinAuthHandler
.
GetFinalAuthToken
(
args
.
WebSession
.
Request
.
Host
,
serverToken
,
args
.
Id
);
var
clientToken
=
WinAuthHandler
.
GetFinalAuthToken
(
args
.
WebSession
.
Request
.
Host
,
serverToken
,
args
.
Id
);
...
...
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