mirror of
https://github.com/nghttp2/nghttp2.git
synced 2025-12-07 10:38:53 +08:00
nghttpx: Use omit minor version in case of HTTP/2 in via header and accesslog
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user