Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
9afebcb2
Commit
9afebcb2
authored
Dec 21, 2013
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Ignore port when rewriting location header
parent
ccfa13cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
17 deletions
+5
-17
src/http2.cc
src/http2.cc
+5
-17
No files found.
src/http2.cc
View file @
9afebcb2
...
...
@@ -457,27 +457,15 @@ std::string rewrite_location_uri(const std::string& uri,
if
((
u
.
field_set
&
(
1
<<
UF_HOST
))
==
0
)
{
return
""
;
}
std
::
string
host
;
copy_url_component
(
host
,
&
u
,
UF_HOST
,
uri
.
c_str
());
if
(
u
.
field_set
&
(
1
<<
UF_PORT
))
{
host
+=
":"
;
host
+=
util
::
utos
(
u
.
port
);
if
(
host
!=
request_host
)
{
// :authority or host have "host", but host in location header
// field may have "host:port".
auto
field
=
&
u
.
field_data
[
UF_HOST
];
if
(
!
util
::
streq
(
request_host
.
c_str
(),
request_host
.
size
(),
&
uri
[
field
->
off
],
field
->
len
)
||
downstream_port
!=
u
.
port
)
{
return
""
;
}
}
}
else
if
(
host
!=
request_host
)
{
auto
field
=
&
u
.
field_data
[
UF_HOST
];
if
(
!
util
::
startsWith
(
std
::
begin
(
request_host
),
std
::
end
(
request_host
),
&
uri
[
field
->
off
],
&
uri
[
field
->
off
]
+
field
->
len
)
||
(
request_host
.
size
()
!=
field
->
len
&&
request_host
[
field
->
len
]
!=
':'
))
{
return
""
;
}
std
::
string
res
=
upstream_scheme
;
res
+=
"://"
;
auto
field
=
&
u
.
field_data
[
UF_HOST
];
res
.
append
(
&
uri
[
field
->
off
],
field
->
len
);
if
(
upstream_scheme
==
"http"
)
{
if
(
upstream_port
!=
80
)
{
...
...
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