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
4d1782f7
Commit
4d1782f7
authored
Oct 13, 2019
by
Honfika
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
20424032
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
10 additions
and
18 deletions
+10
-18
HeaderBuilder.cs
src/Titanium.Web.Proxy/Http/HeaderBuilder.cs
+2
-2
Request.cs
src/Titanium.Web.Proxy/Http/Request.cs
+1
-6
Response.cs
src/Titanium.Web.Proxy/Http/Response.cs
+1
-6
GenericResponse.cs
src/Titanium.Web.Proxy/Http/Responses/GenericResponse.cs
+2
-1
Http2Helper.cs
src/Titanium.Web.Proxy/Http2/Http2Helper.cs
+1
-0
Titanium.Web.Proxy.Mono.csproj
src/Titanium.Web.Proxy/Titanium.Web.Proxy.Mono.csproj
+1
-1
Titanium.Web.Proxy.NetCore.csproj
src/Titanium.Web.Proxy/Titanium.Web.Proxy.NetCore.csproj
+1
-1
Titanium.Web.Proxy.csproj
src/Titanium.Web.Proxy/Titanium.Web.Proxy.csproj
+1
-1
No files found.
src/Titanium.Web.Proxy/Http/HeaderBuilder.cs
View file @
4d1782f7
...
@@ -73,9 +73,9 @@ namespace Titanium.Web.Proxy.Http
...
@@ -73,9 +73,9 @@ namespace Titanium.Web.Proxy.Http
var
buf
=
ArrayPool
<
byte
>.
Shared
.
Rent
(
str
.
Length
*
4
);
var
buf
=
ArrayPool
<
byte
>.
Shared
.
Rent
(
str
.
Length
*
4
);
var
span
=
new
Span
<
byte
>(
buf
);
var
span
=
new
Span
<
byte
>(
buf
);
encoding
.
GetBytes
(
str
.
AsSpan
(),
span
);
int
bytes
=
encoding
.
GetBytes
(
str
.
AsSpan
(),
span
);
stream
.
Write
(
span
);
stream
.
Write
(
span
.
Slice
(
0
,
bytes
)
);
ArrayPool
<
byte
>.
Shared
.
Return
(
buf
);
ArrayPool
<
byte
>.
Shared
.
Return
(
buf
);
#else
#else
var
data
=
encoding
.
GetBytes
(
str
);
var
data
=
encoding
.
GetBytes
(
str
);
...
...
src/Titanium.Web.Proxy/Http/Request.cs
View file @
4d1782f7
...
@@ -157,12 +157,7 @@ namespace Titanium.Web.Proxy.Http
...
@@ -157,12 +157,7 @@ namespace Titanium.Web.Proxy.Http
{
{
var
headerBuilder
=
new
HeaderBuilder
();
var
headerBuilder
=
new
HeaderBuilder
();
headerBuilder
.
WriteRequestLine
(
Method
,
RequestUriString
,
HttpVersion
);
headerBuilder
.
WriteRequestLine
(
Method
,
RequestUriString
,
HttpVersion
);
foreach
(
var
header
in
Headers
)
headerBuilder
.
WriteHeaders
(
Headers
);
{
headerBuilder
.
WriteHeader
(
header
);
}
headerBuilder
.
WriteLine
();
return
HttpHelper
.
HeaderEncoding
.
GetString
(
headerBuilder
.
GetBytes
());
return
HttpHelper
.
HeaderEncoding
.
GetString
(
headerBuilder
.
GetBytes
());
}
}
}
}
...
...
src/Titanium.Web.Proxy/Http/Response.cs
View file @
4d1782f7
...
@@ -37,7 +37,7 @@ namespace Titanium.Web.Proxy.Http
...
@@ -37,7 +37,7 @@ namespace Titanium.Web.Proxy.Http
/// <summary>
/// <summary>
/// Response Status description.
/// Response Status description.
/// </summary>
/// </summary>
public
string
StatusDescription
{
get
;
set
;
}
public
string
StatusDescription
{
get
;
set
;
}
=
string
.
Empty
;
/// <summary>
/// <summary>
/// Has response body?
/// Has response body?
...
@@ -122,11 +122,6 @@ namespace Titanium.Web.Proxy.Http
...
@@ -122,11 +122,6 @@ namespace Titanium.Web.Proxy.Http
}
}
}
}
internal
static
string
CreateResponseLine
(
Version
version
,
int
statusCode
,
string
statusDescription
)
{
return
$"HTTP/
{
version
.
Major
}
.
{
version
.
Minor
}
{
statusCode
}
{
statusDescription
}
"
;
}
internal
static
void
ParseResponseLine
(
string
httpStatus
,
out
Version
version
,
out
int
statusCode
,
internal
static
void
ParseResponseLine
(
string
httpStatus
,
out
Version
version
,
out
int
statusCode
,
out
string
statusDescription
)
out
string
statusDescription
)
{
{
...
...
src/Titanium.Web.Proxy/Http/Responses/GenericResponse.cs
View file @
4d1782f7
...
@@ -15,7 +15,7 @@ namespace Titanium.Web.Proxy.Http.Responses
...
@@ -15,7 +15,7 @@ namespace Titanium.Web.Proxy.Http.Responses
public
GenericResponse
(
HttpStatusCode
status
)
public
GenericResponse
(
HttpStatusCode
status
)
{
{
StatusCode
=
(
int
)
status
;
StatusCode
=
(
int
)
status
;
StatusDescription
=
Get
(
StatusCode
);
StatusDescription
=
Get
(
StatusCode
)
??
string
.
Empty
;
}
}
/// <summary>
/// <summary>
...
@@ -98,6 +98,7 @@ namespace Titanium.Web.Proxy.Http.Responses
...
@@ -98,6 +98,7 @@ namespace Titanium.Web.Proxy.Http.Responses
case
510
:
return
"Not Extended"
;
case
510
:
return
"Not Extended"
;
case
511
:
return
"Network Authentication Required"
;
case
511
:
return
"Network Authentication Required"
;
}
}
return
null
;
return
null
;
}
}
}
}
...
...
src/Titanium.Web.Proxy/Http2/Http2Helper.cs
View file @
4d1782f7
...
@@ -259,6 +259,7 @@ namespace Titanium.Web.Proxy.Http2
...
@@ -259,6 +259,7 @@ namespace Titanium.Web.Proxy.Http2
response
.
HttpVersion
=
HttpVersion
.
Version20
;
response
.
HttpVersion
=
HttpVersion
.
Version20
;
int
.
TryParse
(
headerListener
.
Status
,
out
int
statusCode
);
int
.
TryParse
(
headerListener
.
Status
,
out
int
statusCode
);
response
.
StatusCode
=
statusCode
;
response
.
StatusCode
=
statusCode
;
response
.
StatusDescription
=
string
.
Empty
;
}
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
...
...
src/Titanium.Web.Proxy/Titanium.Web.Proxy.Mono.csproj
View file @
4d1782f7
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<SignAssembly>True</SignAssembly>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>StrongNameKey.snk</AssemblyOriginatorKeyFile>
<AssemblyOriginatorKeyFile>StrongNameKey.snk</AssemblyOriginatorKeyFile>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<LangVersion>
7.1
</LangVersion>
<LangVersion>
8.0
</LangVersion>
<Platforms>AnyCPU;x64</Platforms>
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>
</PropertyGroup>
...
...
src/Titanium.Web.Proxy/Titanium.Web.Proxy.NetCore.csproj
View file @
4d1782f7
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
<AssemblyOriginatorKeyFile>StrongNameKey.snk</AssemblyOriginatorKeyFile>
<AssemblyOriginatorKeyFile>StrongNameKey.snk</AssemblyOriginatorKeyFile>
<DelaySign>False</DelaySign>
<DelaySign>False</DelaySign>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<LangVersion>
7.1
</LangVersion>
<LangVersion>
8.0
</LangVersion>
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
...
...
src/Titanium.Web.Proxy/Titanium.Web.Proxy.csproj
View file @
4d1782f7
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
<AssemblyOriginatorKeyFile>StrongNameKey.snk</AssemblyOriginatorKeyFile>
<AssemblyOriginatorKeyFile>StrongNameKey.snk</AssemblyOriginatorKeyFile>
<DelaySign>False</DelaySign>
<DelaySign>False</DelaySign>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<LangVersion>
7.1
</LangVersion>
<LangVersion>
8.0
</LangVersion>
</PropertyGroup>
</PropertyGroup>
<ItemGroup>
<ItemGroup>
...
...
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