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
d2257308
Commit
d2257308
authored
9 years ago
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Add x-http2-push header field for pushed resource
Fixes GH-352
parent
11485845
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
src/shrpx_http2_upstream.cc
src/shrpx_http2_upstream.cc
+9
-2
No files found.
src/shrpx_http2_upstream.cc
View file @
d2257308
...
...
@@ -1321,8 +1321,9 @@ int Http2Upstream::on_downstream_header_complete(Downstream *downstream) {
size_t
nheader
=
downstream
->
get_response_headers
().
size
();
auto
nva
=
std
::
vector
<
nghttp2_nv
>
();
// 3 means :status and possible server and via header field.
nva
.
reserve
(
nheader
+
3
+
get_config
()
->
add_response_headers
.
size
());
// 4 means :status and possible server, via and x-http2-push header
// field.
nva
.
reserve
(
nheader
+
4
+
get_config
()
->
add_response_headers
.
size
());
std
::
string
via_value
;
auto
response_status
=
util
::
utos
(
downstream
->
get_response_http_status
());
nva
.
push_back
(
http2
::
make_nv_ls
(
":status"
,
response_status
));
...
...
@@ -1376,6 +1377,12 @@ int Http2Upstream::on_downstream_header_complete(Downstream *downstream) {
nva
.
push_back
(
http2
::
make_nv
(
p
.
first
,
p
.
second
));
}
if
(
downstream
->
get_stream_id
()
%
2
==
0
)
{
// This header field is basically for human on client side to
// figure out that the resource is pushed.
nva
.
push_back
(
http2
::
make_nv_ll
(
"x-http2-push"
,
"1"
));
}
if
(
LOG_ENABLED
(
INFO
))
{
log_response_headers
(
downstream
,
nva
);
}
...
...
This diff is collapsed.
Click to expand it.
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