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
842509da
Commit
842509da
authored
Mar 11, 2018
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't allow 101 HTTP status code because HTTP/2 removes HTTP Upgrade
parent
4add618a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
lib/nghttp2_http.c
lib/nghttp2_http.c
+1
-1
tests/nghttp2_session_test.c
tests/nghttp2_session_test.c
+7
-0
No files found.
lib/nghttp2_http.c
View file @
842509da
...
...
@@ -244,7 +244,7 @@ static int http_response_on_header(nghttp2_stream *stream, nghttp2_hd_nv *nv,
return
NGHTTP2_ERR_HTTP_HEADER
;
}
stream
->
status_code
=
(
int16_t
)
parse_uint
(
nv
->
value
->
base
,
nv
->
value
->
len
);
if
(
stream
->
status_code
==
-
1
)
{
if
(
stream
->
status_code
==
-
1
||
stream
->
status_code
==
101
)
{
return
NGHTTP2_ERR_HTTP_HEADER
;
}
break
;
...
...
tests/nghttp2_session_test.c
View file @
842509da
...
...
@@ -10437,6 +10437,7 @@ void test_nghttp2_http_mandatory_headers(void) {
MAKE_NV
(
"content-length"
,
"0"
)};
const
nghttp2_nv
clnonzero204_resnv
[]
=
{
MAKE_NV
(
":status"
,
"204"
),
MAKE_NV
(
"content-length"
,
"100"
)};
const
nghttp2_nv
status101_resnv
[]
=
{
MAKE_NV
(
":status"
,
"101"
)};
/* test case for request */
const
nghttp2_nv
nopath_reqnv
[]
=
{
MAKE_NV
(
":scheme"
,
"https"
),
...
...
@@ -10551,6 +10552,12 @@ void test_nghttp2_http_mandatory_headers(void) {
session
,
&
deflater
,
21
,
NGHTTP2_STREAM_OPENING
,
clnonzero204_resnv
,
ARRLEN
(
clnonzero204_resnv
));
/* status code 101 should not be used in HTTP/2 because it is used
for HTTP Upgrade which HTTP/2 removes. */
check_nghttp2_http_recv_headers_fail
(
session
,
&
deflater
,
23
,
NGHTTP2_STREAM_OPENING
,
status101_resnv
,
ARRLEN
(
status101_resnv
));
nghttp2_hd_deflate_free
(
&
deflater
);
nghttp2_session_del
(
session
);
...
...
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