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
5634c7ff
Commit
5634c7ff
authored
Sep 09, 2012
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shrpx: Ignore response body if HTTP status code is 1xx, 204 or 304
parent
3d694c89
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
examples/shrpx_downstream.cc
examples/shrpx_downstream.cc
+9
-8
No files found.
examples/shrpx_downstream.cc
View file @
5634c7ff
...
...
@@ -536,14 +536,15 @@ int htp_hdrs_completecb(http_parser *htp)
!=
0
)
{
return
-
1
;
}
if
(
downstream
->
get_request_method
()
==
"HEAD"
)
{
// Ignore the response body. HEAD response may contain
// Content-Length or Transfer-Encoding: chunked.
return
1
;
}
else
{
return
0
;
}
unsigned
int
status
=
downstream
->
get_response_http_status
();
// Ignore the response body. HEAD response may contain
// Content-Length or Transfer-Encoding: chunked. Some server send
// 304 status code with nonzero Content-Length, but without response
// body. See
// http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-20#section-3.3
return
downstream
->
get_request_method
()
==
"HEAD"
||
(
100
<=
status
&&
status
<=
199
)
||
status
==
204
||
status
==
304
?
1
:
0
;
}
}
// namespace
...
...
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