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
556212a6
Commit
556212a6
authored
Aug 24, 2013
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Replace \r\n in the header field to SPC in http downstream
parent
091f38a9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
0 deletions
+12
-0
src/shrpx_http.cc
src/shrpx_http.cc
+9
-0
src/shrpx_http.h
src/shrpx_http.h
+2
-0
src/shrpx_http_downstream_connection.cc
src/shrpx_http_downstream_connection.cc
+1
-0
No files found.
src/shrpx_http.cc
View file @
556212a6
...
...
@@ -122,6 +122,15 @@ void capitalize(std::string& s, size_t offset)
}
}
void
sanitize_header_value
(
std
::
string
&
s
,
size_t
offset
)
{
for
(
size_t
i
=
offset
,
eoi
=
s
.
size
();
i
<
eoi
;
++
i
)
{
if
(
s
[
i
]
==
'\r'
||
s
[
i
]
==
'\n'
)
{
s
[
i
]
=
' '
;
}
}
}
std
::
string
colorizeHeaders
(
const
char
*
hdrs
)
{
std
::
string
nhdrs
;
...
...
src/shrpx_http.h
View file @
556212a6
...
...
@@ -41,6 +41,8 @@ std::string create_via_header_value(int major, int minor);
void
capitalize
(
std
::
string
&
s
,
size_t
offset
);
void
sanitize_header_value
(
std
::
string
&
s
,
size_t
offset
);
// Adds ANSI color codes to HTTP headers |hdrs|.
std
::
string
colorizeHeaders
(
const
char
*
hdrs
);
...
...
src/shrpx_http_downstream_connection.cc
View file @
556212a6
...
...
@@ -160,6 +160,7 @@ int HttpDownstreamConnection::push_request_headers()
http
::
capitalize
(
hdrs
,
hdrs
.
size
()
-
(
*
i
).
first
.
size
());
hdrs
+=
": "
;
hdrs
+=
(
*
i
).
second
;
http
::
sanitize_header_value
(
hdrs
,
hdrs
.
size
()
-
(
*
i
).
second
.
size
());
hdrs
+=
"
\r\n
"
;
}
if
(
downstream_
->
get_request_connection_close
())
{
...
...
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