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
5cecf4f1
Commit
5cecf4f1
authored
Aug 22, 2018
by
Paul S
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix environment specific header termination on Unix.
parent
0478f21e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
HttpWebClient.cs
Titanium.Web.Proxy/Http/HttpWebClient.cs
+8
-4
No files found.
Titanium.Web.Proxy/Http/HttpWebClient.cs
View file @
5cecf4f1
...
@@ -16,6 +16,7 @@ namespace Titanium.Web.Proxy.Http
...
@@ -16,6 +16,7 @@ namespace Titanium.Web.Proxy.Http
/// </summary>
/// </summary>
public
class
HttpWebClient
public
class
HttpWebClient
{
{
private
const
string
CRLF
=
"\r\n"
;
internal
HttpWebClient
(
Request
request
=
null
,
Response
response
=
null
)
internal
HttpWebClient
(
Request
request
=
null
,
Response
response
=
null
)
{
{
...
@@ -103,14 +104,16 @@ namespace Titanium.Web.Proxy.Http
...
@@ -103,14 +104,16 @@ namespace Titanium.Web.Proxy.Http
Request
.
HttpVersion
),
cancellationToken
);
Request
.
HttpVersion
),
cancellationToken
);
var
headerBuilder
=
new
StringBuilder
();
var
headerBuilder
=
new
StringBuilder
();
// Send Authentication to Upstream proxy if needed
// Send Authentication to Upstream proxy if needed
if
(!
isTransparent
&&
upstreamProxy
!=
null
if
(!
isTransparent
&&
upstreamProxy
!=
null
&&
ServerConnection
.
IsHttps
==
false
&&
ServerConnection
.
IsHttps
==
false
&&
!
string
.
IsNullOrEmpty
(
upstreamProxy
.
UserName
)
&&
!
string
.
IsNullOrEmpty
(
upstreamProxy
.
UserName
)
&&
upstreamProxy
.
Password
!=
null
)
&&
upstreamProxy
.
Password
!=
null
)
{
{
headerBuilder
.
AppendLine
(
HttpHeader
.
ProxyConnectionKeepAlive
.
ToString
());
headerBuilder
.
AppendFormat
(
"{0}{1}"
,
HttpHeader
.
ProxyConnectionKeepAlive
,
CRLF
);
headerBuilder
.
AppendLine
(
HttpHeader
.
GetProxyAuthorizationHeader
(
upstreamProxy
.
UserName
,
upstreamProxy
.
Password
).
ToString
());
headerBuilder
.
AppendFormat
(
"{0}{1}"
,
HttpHeader
.
GetProxyAuthorizationHeader
(
upstreamProxy
.
UserName
,
upstreamProxy
.
Password
));
}
}
// write request headers
// write request headers
...
@@ -118,11 +121,12 @@ namespace Titanium.Web.Proxy.Http
...
@@ -118,11 +121,12 @@ namespace Titanium.Web.Proxy.Http
{
{
if
(
isTransparent
||
header
.
Name
!=
KnownHeaders
.
ProxyAuthorization
)
if
(
isTransparent
||
header
.
Name
!=
KnownHeaders
.
ProxyAuthorization
)
{
{
headerBuilder
.
Append
Line
(
header
.
ToString
()
);
headerBuilder
.
Append
Format
(
"{0}{1}"
,
header
,
CRLF
);
}
}
}
}
headerBuilder
.
AppendLine
();
headerBuilder
.
Append
(
CRLF
);
await
writer
.
WriteAsync
(
headerBuilder
.
ToString
(),
cancellationToken
);
await
writer
.
WriteAsync
(
headerBuilder
.
ToString
(),
cancellationToken
);
if
(
enable100ContinueBehaviour
)
if
(
enable100ContinueBehaviour
)
...
...
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