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
c98cf045
Commit
c98cf045
authored
Feb 24, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Use omit minor version in case of HTTP/2 in via header and accesslog
parent
814c7e68
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
8 deletions
+12
-8
integration-tests/nghttpx_http1_test.go
integration-tests/nghttpx_http1_test.go
+2
-2
integration-tests/nghttpx_http2_test.go
integration-tests/nghttpx_http2_test.go
+2
-2
src/shrpx_http.cc
src/shrpx_http.cc
+4
-2
src/shrpx_log.cc
src/shrpx_log.cc
+4
-2
No files found.
integration-tests/nghttpx_http1_test.go
View file @
c98cf045
...
...
@@ -349,7 +349,7 @@ func TestH1H2GenerateVia(t *testing.T) {
if
err
!=
nil
{
t
.
Fatalf
(
"Error st.http1() = %v"
,
err
)
}
if
got
,
want
:=
res
.
header
.
Get
(
"Via"
),
"2
.0
nghttpx"
;
got
!=
want
{
if
got
,
want
:=
res
.
header
.
Get
(
"Via"
),
"2 nghttpx"
;
got
!=
want
{
t
.
Errorf
(
"Via: %v; want %v"
,
got
,
want
)
}
}
...
...
@@ -374,7 +374,7 @@ func TestH1H2AppendVia(t *testing.T) {
if
err
!=
nil
{
t
.
Fatalf
(
"Error st.http1() = %v"
,
err
)
}
if
got
,
want
:=
res
.
header
.
Get
(
"Via"
),
"bar, 2
.0
nghttpx"
;
got
!=
want
{
if
got
,
want
:=
res
.
header
.
Get
(
"Via"
),
"bar, 2 nghttpx"
;
got
!=
want
{
t
.
Errorf
(
"Via: %v; want %v"
,
got
,
want
)
}
}
...
...
integration-tests/nghttpx_http2_test.go
View file @
c98cf045
...
...
@@ -125,7 +125,7 @@ func TestH2H1StripAddXff(t *testing.T) {
// from backend server.
func
TestH2H1GenerateVia
(
t
*
testing
.
T
)
{
st
:=
newServerTester
(
nil
,
t
,
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
if
got
,
want
:=
r
.
Header
.
Get
(
"Via"
),
"2
.0
nghttpx"
;
got
!=
want
{
if
got
,
want
:=
r
.
Header
.
Get
(
"Via"
),
"2 nghttpx"
;
got
!=
want
{
t
.
Errorf
(
"Via: %v; want %v"
,
got
,
want
)
}
})
...
...
@@ -146,7 +146,7 @@ func TestH2H1GenerateVia(t *testing.T) {
// header field to and from backend server.
func
TestH2H1AppendVia
(
t
*
testing
.
T
)
{
st
:=
newServerTester
(
nil
,
t
,
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
if
got
,
want
:=
r
.
Header
.
Get
(
"Via"
),
"foo, 2
.0
nghttpx"
;
got
!=
want
{
if
got
,
want
:=
r
.
Header
.
Get
(
"Via"
),
"foo, 2 nghttpx"
;
got
!=
want
{
t
.
Errorf
(
"Via: %v; want %v"
,
got
,
want
)
}
w
.
Header
()
.
Add
(
"Via"
,
"bar"
)
...
...
src/shrpx_http.cc
View file @
c98cf045
...
...
@@ -55,8 +55,10 @@ std::string create_error_html(unsigned int status_code) {
std
::
string
create_via_header_value
(
int
major
,
int
minor
)
{
std
::
string
hdrs
;
hdrs
+=
static_cast
<
char
>
(
major
+
'0'
);
hdrs
+=
"."
;
hdrs
+=
static_cast
<
char
>
(
minor
+
'0'
);
if
(
major
<
2
)
{
hdrs
+=
"."
;
hdrs
+=
static_cast
<
char
>
(
minor
+
'0'
);
}
hdrs
+=
" nghttpx"
;
return
hdrs
;
}
...
...
src/shrpx_log.cc
View file @
c98cf045
...
...
@@ -197,8 +197,10 @@ void upstream_accesslog(const std::vector<LogFragment> &lfv, LogSpec *lgsp) {
std
::
tie
(
p
,
avail
)
=
copy
(
lgsp
->
path
,
avail
,
p
);
std
::
tie
(
p
,
avail
)
=
copy
(
" HTTP/"
,
avail
,
p
);
std
::
tie
(
p
,
avail
)
=
copy
(
util
::
utos
(
lgsp
->
major
).
c_str
(),
avail
,
p
);
std
::
tie
(
p
,
avail
)
=
copy
(
"."
,
avail
,
p
);
std
::
tie
(
p
,
avail
)
=
copy
(
util
::
utos
(
lgsp
->
minor
).
c_str
(),
avail
,
p
);
if
(
lgsp
->
major
<
2
)
{
std
::
tie
(
p
,
avail
)
=
copy
(
"."
,
avail
,
p
);
std
::
tie
(
p
,
avail
)
=
copy
(
util
::
utos
(
lgsp
->
minor
).
c_str
(),
avail
,
p
);
}
break
;
case
SHRPX_LOGF_STATUS
:
std
::
tie
(
p
,
avail
)
=
copy
(
util
::
utos
(
lgsp
->
status
).
c_str
(),
avail
,
p
);
...
...
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