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
9c3a4f25
Commit
9c3a4f25
authored
Mar 27, 2018
by
Honfika
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix when body was set by the user
parent
ce0bba9b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
6 deletions
+20
-6
SessionEventArgs.cs
Titanium.Web.Proxy/EventArguments/SessionEventArgs.cs
+0
-1
Request.cs
Titanium.Web.Proxy/Http/Request.cs
+5
-0
RequestResponseBase.cs
Titanium.Web.Proxy/Http/RequestResponseBase.cs
+10
-5
Response.cs
Titanium.Web.Proxy/Http/Response.cs
+5
-0
No files found.
Titanium.Web.Proxy/EventArguments/SessionEventArgs.cs
View file @
9c3a4f25
...
@@ -483,7 +483,6 @@ namespace Titanium.Web.Proxy.EventArguments
...
@@ -483,7 +483,6 @@ namespace Titanium.Web.Proxy.EventArguments
}
}
request
.
Body
=
body
;
request
.
Body
=
body
;
request
.
UpdateContentLength
();
}
}
/// <summary>
/// <summary>
...
...
Titanium.Web.Proxy/Http/Request.cs
View file @
9c3a4f25
...
@@ -102,6 +102,11 @@ namespace Titanium.Web.Proxy.Http
...
@@ -102,6 +102,11 @@ namespace Titanium.Web.Proxy.Http
internal
override
void
EnsureBodyAvailable
(
bool
throwWhenNotReadYet
=
true
)
internal
override
void
EnsureBodyAvailable
(
bool
throwWhenNotReadYet
=
true
)
{
{
if
(
BodyInternal
!=
null
)
{
return
;
}
//GET request don't have a request body to read
//GET request don't have a request body to read
if
(!
HasBody
)
if
(!
HasBody
)
{
{
...
...
Titanium.Web.Proxy/Http/RequestResponseBase.cs
View file @
9c3a4f25
...
@@ -16,7 +16,7 @@ namespace Titanium.Web.Proxy.Http
...
@@ -16,7 +16,7 @@ namespace Titanium.Web.Proxy.Http
/// <summary>
/// <summary>
/// Cached body content as byte array
/// Cached body content as byte array
/// </summary>
/// </summary>
pr
ivate
byte
[]
body
;
pr
otected
byte
[]
BodyInternal
;
/// <summary>
/// <summary>
/// Cached body as string
/// Cached body as string
...
@@ -127,11 +127,11 @@ namespace Titanium.Web.Proxy.Http
...
@@ -127,11 +127,11 @@ namespace Titanium.Web.Proxy.Http
get
get
{
{
EnsureBodyAvailable
();
EnsureBodyAvailable
();
return
body
;
return
BodyInternal
;
}
}
internal
set
internal
set
{
{
body
=
value
;
BodyInternal
=
value
;
bodyString
=
null
;
bodyString
=
null
;
//If there is a content length header update it
//If there is a content length header update it
...
@@ -173,6 +173,11 @@ namespace Titanium.Web.Proxy.Http
...
@@ -173,6 +173,11 @@ namespace Titanium.Web.Proxy.Http
internal
byte
[]
CompressBodyAndUpdateContentLength
()
internal
byte
[]
CompressBodyAndUpdateContentLength
()
{
{
if
(!
IsBodyRead
)
{
return
null
;
}
bool
isChunked
=
IsChunked
;
bool
isChunked
=
IsChunked
;
string
contentEncoding
=
ContentEncoding
;
string
contentEncoding
=
ContentEncoding
;
...
@@ -219,7 +224,7 @@ namespace Titanium.Web.Proxy.Http
...
@@ -219,7 +224,7 @@ namespace Titanium.Web.Proxy.Http
internal
void
UpdateContentLength
()
internal
void
UpdateContentLength
()
{
{
ContentLength
=
IsChunked
?
-
1
:
body
?.
Length
??
0
;
ContentLength
=
IsChunked
?
-
1
:
BodyInternal
?.
Length
??
0
;
}
}
/// <summary>
/// <summary>
...
@@ -229,7 +234,7 @@ namespace Titanium.Web.Proxy.Http
...
@@ -229,7 +234,7 @@ namespace Titanium.Web.Proxy.Http
{
{
if
(!
KeepBody
)
if
(!
KeepBody
)
{
{
body
=
null
;
BodyInternal
=
null
;
bodyString
=
null
;
bodyString
=
null
;
}
}
}
}
...
...
Titanium.Web.Proxy/Http/Response.cs
View file @
9c3a4f25
...
@@ -81,6 +81,11 @@ namespace Titanium.Web.Proxy.Http
...
@@ -81,6 +81,11 @@ namespace Titanium.Web.Proxy.Http
internal
override
void
EnsureBodyAvailable
(
bool
throwWhenNotReadYet
=
true
)
internal
override
void
EnsureBodyAvailable
(
bool
throwWhenNotReadYet
=
true
)
{
{
if
(
BodyInternal
!=
null
)
{
return
;
}
if
(!
IsBodyRead
&&
throwWhenNotReadYet
)
if
(!
IsBodyRead
&&
throwWhenNotReadYet
)
{
{
throw
new
Exception
(
"Response body is not read yet. "
+
throw
new
Exception
(
"Response body is not read yet. "
+
...
...
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