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
e4c68b0b
Commit
e4c68b0b
authored
Apr 28, 2016
by
justcoding121
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ExpectContinue correctly handle
Send request before user call back only for expectcontinue
parent
5303951b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
23 deletions
+27
-23
RequestHandler.cs
Titanium.Web.Proxy/RequestHandler.cs
+27
-23
No files found.
Titanium.Web.Proxy/RequestHandler.cs
View file @
e4c68b0b
...
...
@@ -132,7 +132,7 @@ namespace Titanium.Web.Proxy
//if(endPoint.UseServerNameIndication)
//{
// //implement in future once SNI supported by SSL stream
// certificate = CertManager.CreateCertificate(
endPoint.GenericCertificate
Name);
// certificate = CertManager.CreateCertificate(
host
Name);
//}
//else
certificate
=
CertManager
.
CreateCertificate
(
endPoint
.
GenericCertificateName
);
...
...
@@ -207,7 +207,6 @@ namespace Titanium.Web.Proxy
version
=
new
Version
(
1
,
0
);
}
args
.
ProxySession
.
Request
.
RequestHeaders
=
new
List
<
HttpHeader
>();
string
tmpLine
;
...
...
@@ -217,13 +216,9 @@ namespace Titanium.Web.Proxy
args
.
ProxySession
.
Request
.
RequestHeaders
.
Add
(
new
HttpHeader
(
header
[
0
],
header
[
1
]));
}
var
httpRemoteUri
=
new
Uri
(!
IsHttps
?
httpCmdSplit
[
1
]
:
(
string
.
Concat
(
"https://"
,
args
.
ProxySession
.
Request
.
Host
,
httpCmdSplit
[
1
])));
args
.
IsHttps
=
IsHttps
;
args
.
ProxySession
.
Request
.
RequestUri
=
httpRemoteUri
;
args
.
ProxySession
.
Request
.
Method
=
httpMethod
;
...
...
@@ -249,24 +244,8 @@ namespace Titanium.Web.Proxy
lastRequestHostName
=
args
.
ProxySession
.
Request
.
RequestUri
.
Host
;
args
.
ProxySession
.
Request
.
Host
=
args
.
ProxySession
.
Request
.
RequestUri
.
Host
;
args
.
ProxySession
.
SetConnection
(
connection
);
args
.
ProxySession
.
SendRequest
();
if
(
Enable100ContinueBehaviour
)
if
(
args
.
ProxySession
.
Request
.
Is100Continue
)
{
WriteResponseStatus
(
args
.
ProxySession
.
Response
.
HttpVersion
,
"100"
,
"Continue"
,
args
.
Client
.
ClientStreamWriter
);
args
.
Client
.
ClientStreamWriter
.
WriteLine
();
}
else
if
(
args
.
ProxySession
.
Request
.
ExpectationFailed
)
{
WriteResponseStatus
(
args
.
ProxySession
.
Response
.
HttpVersion
,
"417"
,
"Expectation Failed"
,
args
.
Client
.
ClientStreamWriter
);
args
.
Client
.
ClientStreamWriter
.
WriteLine
();
}
//If requested interception
if
(
BeforeRequest
!=
null
)
{
...
...
@@ -275,12 +254,37 @@ namespace Titanium.Web.Proxy
args
.
ProxySession
.
Request
.
RequestLocked
=
true
;
if
(
args
.
ProxySession
.
Request
.
ExpectContinue
)
{
args
.
ProxySession
.
SetConnection
(
connection
);
args
.
ProxySession
.
SendRequest
();
}
if
(
Enable100ContinueBehaviour
)
if
(
args
.
ProxySession
.
Request
.
Is100Continue
)
{
WriteResponseStatus
(
args
.
ProxySession
.
Response
.
HttpVersion
,
"100"
,
"Continue"
,
args
.
Client
.
ClientStreamWriter
);
args
.
Client
.
ClientStreamWriter
.
WriteLine
();
}
else
if
(
args
.
ProxySession
.
Request
.
ExpectationFailed
)
{
WriteResponseStatus
(
args
.
ProxySession
.
Response
.
HttpVersion
,
"417"
,
"Expectation Failed"
,
args
.
Client
.
ClientStreamWriter
);
args
.
Client
.
ClientStreamWriter
.
WriteLine
();
}
if
(
args
.
ProxySession
.
Request
.
CancelRequest
)
{
Dispose
(
client
,
clientStream
,
clientStreamReader
,
clientStreamWriter
,
args
);
break
;
}
if
(!
args
.
ProxySession
.
Request
.
ExpectContinue
)
{
args
.
ProxySession
.
SetConnection
(
connection
);
args
.
ProxySession
.
SendRequest
();
}
//If request was modified by user
if
(
args
.
ProxySession
.
Request
.
RequestBodyRead
)
...
...
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