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
6eb2829e
Commit
6eb2829e
authored
Nov 03, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Strip content-length with 204 or 200 to CONNECT in mruby
parent
6ad9ddcd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
7 deletions
+20
-7
src/shrpx_mruby_module_response.cc
src/shrpx_mruby_module_response.cc
+20
-7
No files found.
src/shrpx_mruby_module_response.cc
View file @
6eb2829e
...
@@ -190,6 +190,7 @@ namespace {
...
@@ -190,6 +190,7 @@ namespace {
mrb_value
response_return
(
mrb_state
*
mrb
,
mrb_value
self
)
{
mrb_value
response_return
(
mrb_state
*
mrb
,
mrb_value
self
)
{
auto
data
=
static_cast
<
MRubyAssocData
*>
(
mrb
->
ud
);
auto
data
=
static_cast
<
MRubyAssocData
*>
(
mrb
->
ud
);
auto
downstream
=
data
->
downstream
;
auto
downstream
=
data
->
downstream
;
auto
&
req
=
downstream
->
request
();
auto
&
resp
=
downstream
->
response
();
auto
&
resp
=
downstream
->
response
();
int
rv
;
int
rv
;
...
@@ -215,16 +216,28 @@ mrb_value response_return(mrb_state *mrb, mrb_value self) {
...
@@ -215,16 +216,28 @@ mrb_value response_return(mrb_state *mrb, mrb_value self) {
bodylen
=
vallen
;
bodylen
=
vallen
;
}
}
auto
content_length
=
util
::
make_string_ref_uint
(
balloc
,
bodylen
);
auto
cl
=
resp
.
fs
.
header
(
http2
::
HD_CONTENT_LENGTH
);
auto
cl
=
resp
.
fs
.
header
(
http2
::
HD_CONTENT_LENGTH
);
if
(
resp
.
http_status
==
204
||
(
resp
.
http_status
==
200
&&
req
.
method
==
HTTP_CONNECT
))
{
if
(
cl
)
{
// Delete content-length here
cl
->
name
=
StringRef
{};
}
resp
.
fs
.
content_length
=
-
1
;
}
else
{
auto
content_length
=
util
::
make_string_ref_uint
(
balloc
,
vallen
);
if
(
cl
)
{
if
(
cl
)
{
cl
->
value
=
content_length
;
cl
->
value
=
content_length
;
}
else
{
}
else
{
resp
.
fs
.
add_header_token
(
StringRef
::
from_lit
(
"content-length"
),
resp
.
fs
.
add_header_token
(
StringRef
::
from_lit
(
"content-length"
),
content_length
,
false
,
http2
::
HD_CONTENT_LENGTH
);
content_length
,
false
,
http2
::
HD_CONTENT_LENGTH
);
}
}
resp
.
fs
.
content_length
=
bodylen
;
resp
.
fs
.
content_length
=
vallen
;
}
auto
date
=
resp
.
fs
.
header
(
http2
::
HD_DATE
);
auto
date
=
resp
.
fs
.
header
(
http2
::
HD_DATE
);
if
(
!
date
)
{
if
(
!
date
)
{
...
...
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