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
da588f15
Commit
da588f15
authored
Jun 16, 2017
by
Tom Zierbock
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
https://github.com/TomZierbockSiemens/Titanium-Web-Proxy
into develop
parents
4135acd5
acb334ac
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
37 deletions
+28
-37
Request.cs
Titanium.Web.Proxy/Http/Request.cs
+8
-6
Response.cs
Titanium.Web.Proxy/Http/Response.cs
+13
-13
RequestHandler.cs
Titanium.Web.Proxy/RequestHandler.cs
+7
-13
ResponseHandler.cs
Titanium.Web.Proxy/ResponseHandler.cs
+0
-5
No files found.
Titanium.Web.Proxy/Http/Request.cs
View file @
da588f15
...
@@ -33,9 +33,11 @@ namespace Titanium.Web.Proxy.Http
...
@@ -33,9 +33,11 @@ namespace Titanium.Web.Proxy.Http
public
bool
HasBody
=>
Method
==
"POST"
||
Method
==
"PUT"
||
Method
==
"PATCH"
;
public
bool
HasBody
=>
Method
==
"POST"
||
Method
==
"PUT"
||
Method
==
"PATCH"
;
/// <summary>
/// <summary>
/// Request Http hostanem
/// Http hostname header value if exists
/// Note: Changing this does NOT change host in RequestUri
/// Users can set new RequestUri separately
/// </summary>
/// </summary>
internal
string
Host
public
string
Host
{
{
get
get
{
{
...
@@ -57,9 +59,9 @@ namespace Titanium.Web.Proxy.Http
...
@@ -57,9 +59,9 @@ namespace Titanium.Web.Proxy.Http
}
}
/// <summary>
/// <summary>
///
Request content encoding
///
Content encoding header value
/// </summary>
/// </summary>
internal
string
ContentEncoding
public
string
ContentEncoding
{
{
get
get
{
{
...
@@ -231,7 +233,7 @@ namespace Titanium.Web.Proxy.Http
...
@@ -231,7 +233,7 @@ namespace Titanium.Web.Proxy.Http
/// <summary>
/// <summary>
/// Encoding for this request
/// Encoding for this request
/// </summary>
/// </summary>
internal
Encoding
Encoding
=>
this
.
GetEncoding
();
public
Encoding
Encoding
=>
this
.
GetEncoding
();
/// <summary>
/// <summary>
/// Terminates the underlying Tcp Connection to client after current request
/// Terminates the underlying Tcp Connection to client after current request
...
@@ -261,7 +263,7 @@ namespace Titanium.Web.Proxy.Http
...
@@ -261,7 +263,7 @@ namespace Titanium.Web.Proxy.Http
/// <summary>
/// <summary>
/// Does this request has an upgrade to websocket header?
/// Does this request has an upgrade to websocket header?
/// </summary>
/// </summary>
internal
bool
UpgradeToWebSocket
public
bool
UpgradeToWebSocket
{
{
get
get
{
{
...
...
Titanium.Web.Proxy/Http/Response.cs
View file @
da588f15
...
@@ -23,12 +23,15 @@ namespace Titanium.Web.Proxy.Http
...
@@ -23,12 +23,15 @@ namespace Titanium.Web.Proxy.Http
/// </summary>
/// </summary>
public
string
ResponseStatusDescription
{
get
;
set
;
}
public
string
ResponseStatusDescription
{
get
;
set
;
}
internal
Encoding
Encoding
=>
this
.
GetResponseCharacterEncoding
();
/// <summary>
/// Encoding used in response
/// </summary>
public
Encoding
Encoding
=>
this
.
GetResponseCharacterEncoding
();
/// <summary>
/// <summary>
/// Content encoding for this response
/// Content encoding for this response
/// </summary>
/// </summary>
internal
string
ContentEncoding
public
string
ContentEncoding
{
{
get
get
{
{
...
@@ -41,12 +44,15 @@ namespace Titanium.Web.Proxy.Http
...
@@ -41,12 +44,15 @@ namespace Titanium.Web.Proxy.Http
}
}
}
}
internal
Version
HttpVersion
{
get
;
set
;
}
/// <summary>
/// Http version
/// </summary>
public
Version
HttpVersion
{
get
;
set
;
}
/// <summary>
/// <summary>
/// Keep the connection alive?
/// Keep the connection alive?
/// </summary>
/// </summary>
internal
bool
ResponseKeepAlive
public
bool
ResponseKeepAlive
{
{
get
get
{
{
...
@@ -89,7 +95,7 @@ namespace Titanium.Web.Proxy.Http
...
@@ -89,7 +95,7 @@ namespace Titanium.Web.Proxy.Http
/// <summary>
/// <summary>
/// Length of response body
/// Length of response body
/// </summary>
/// </summary>
internal
long
ContentLength
public
long
ContentLength
{
{
get
get
{
{
...
@@ -142,7 +148,7 @@ namespace Titanium.Web.Proxy.Http
...
@@ -142,7 +148,7 @@ namespace Titanium.Web.Proxy.Http
/// <summary>
/// <summary>
/// Response transfer-encoding is chunked?
/// Response transfer-encoding is chunked?
/// </summary>
/// </summary>
internal
bool
IsChunked
public
bool
IsChunked
{
{
get
get
{
{
...
@@ -198,14 +204,8 @@ namespace Titanium.Web.Proxy.Http
...
@@ -198,14 +204,8 @@ namespace Titanium.Web.Proxy.Http
/// </summary>
/// </summary>
public
Dictionary
<
string
,
List
<
HttpHeader
>>
NonUniqueResponseHeaders
{
get
;
set
;
}
public
Dictionary
<
string
,
List
<
HttpHeader
>>
NonUniqueResponseHeaders
{
get
;
set
;
}
/// <summary>
/// Response network stream
/// </summary>
public
Stream
ResponseStream
{
get
;
set
;
}
/// <summary>
/// <summary>
/// response body conten
s
t as byte array
/// response body content as byte array
/// </summary>
/// </summary>
internal
byte
[]
ResponseBody
{
get
;
set
;
}
internal
byte
[]
ResponseBody
{
get
;
set
;
}
...
...
Titanium.Web.Proxy/RequestHandler.cs
View file @
da588f15
...
@@ -339,6 +339,12 @@ namespace Titanium.Web.Proxy
...
@@ -339,6 +339,12 @@ namespace Titanium.Web.Proxy
await
BeforeRequest
.
InvokeParallelAsync
(
this
,
args
);
await
BeforeRequest
.
InvokeParallelAsync
(
this
,
args
);
}
}
if
(
args
.
WebSession
.
Request
.
CancelRequest
)
{
args
.
Dispose
();
break
;
}
//if upgrading to websocket then relay the requet without reading the contents
//if upgrading to websocket then relay the requet without reading the contents
if
(
args
.
WebSession
.
Request
.
UpgradeToWebSocket
)
if
(
args
.
WebSession
.
Request
.
UpgradeToWebSocket
)
{
{
...
@@ -373,13 +379,7 @@ namespace Titanium.Web.Proxy
...
@@ -373,13 +379,7 @@ namespace Titanium.Web.Proxy
args
.
Dispose
();
args
.
Dispose
();
break
;
break
;
}
}
if
(
args
.
WebSession
.
Request
.
CancelRequest
)
{
args
.
Dispose
();
break
;
}
//if connection is closing exit
//if connection is closing exit
if
(
args
.
WebSession
.
Response
.
ResponseKeepAlive
==
false
)
if
(
args
.
WebSession
.
Response
.
ResponseKeepAlive
==
false
)
{
{
...
@@ -424,12 +424,6 @@ namespace Titanium.Web.Proxy
...
@@ -424,12 +424,6 @@ namespace Titanium.Web.Proxy
{
{
args
.
WebSession
.
Request
.
RequestLocked
=
true
;
args
.
WebSession
.
Request
.
RequestLocked
=
true
;
//If request was cancelled by user then dispose the client
if
(
args
.
WebSession
.
Request
.
CancelRequest
)
{
return
true
;
}
//if expect continue is enabled then send the headers first
//if expect continue is enabled then send the headers first
//and see if server would return 100 conitinue
//and see if server would return 100 conitinue
if
(
args
.
WebSession
.
Request
.
ExpectContinue
)
if
(
args
.
WebSession
.
Request
.
ExpectContinue
)
...
...
Titanium.Web.Proxy/ResponseHandler.cs
View file @
da588f15
...
@@ -31,11 +31,6 @@ namespace Titanium.Web.Proxy
...
@@ -31,11 +31,6 @@ namespace Titanium.Web.Proxy
//read response & headers from server
//read response & headers from server
await
args
.
WebSession
.
ReceiveResponse
();
await
args
.
WebSession
.
ReceiveResponse
();
if
(!
args
.
WebSession
.
Response
.
ResponseBodyRead
)
{
args
.
WebSession
.
Response
.
ResponseStream
=
args
.
WebSession
.
ServerConnection
.
Stream
;
}
//check for windows authentication
//check for windows authentication
if
(
EnableWinAuth
if
(
EnableWinAuth
&&
!
RunTime
.
IsRunningOnMono
&&
!
RunTime
.
IsRunningOnMono
...
...
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