|
|
@@ -277,6 +277,12 @@ func TestBuildResponseWithDeflateCompression(t *testing.T) {
|
|
|
if actual != expected {
|
|
|
t.Fatalf(`Unexpected header value, got %q instead of %q`, actual, expected)
|
|
|
}
|
|
|
+
|
|
|
+ expectedVary := "Accept-Encoding"
|
|
|
+ actualVary := resp.Header.Get("Vary")
|
|
|
+ if actualVary != expectedVary {
|
|
|
+ t.Fatalf(`Unexpected vary header value, got %q instead of %q`, actualVary, expectedVary)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
func TestBuildResponseWithCompressionDisabled(t *testing.T) {
|
|
|
@@ -301,6 +307,12 @@ func TestBuildResponseWithCompressionDisabled(t *testing.T) {
|
|
|
if actual != expected {
|
|
|
t.Fatalf(`Unexpected header value, got %q instead of %q`, actual, expected)
|
|
|
}
|
|
|
+
|
|
|
+ expectedVary := ""
|
|
|
+ actualVary := resp.Header.Get("Vary")
|
|
|
+ if actualVary != expectedVary {
|
|
|
+ t.Fatalf(`Unexpected vary header value, got %q instead of %q`, actualVary, expectedVary)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
func TestBuildResponseWithDeflateCompressionAndSmallPayload(t *testing.T) {
|
|
|
@@ -325,6 +337,12 @@ func TestBuildResponseWithDeflateCompressionAndSmallPayload(t *testing.T) {
|
|
|
if actual != expected {
|
|
|
t.Fatalf(`Unexpected header value, got %q instead of %q`, actual, expected)
|
|
|
}
|
|
|
+
|
|
|
+ expectedVary := ""
|
|
|
+ actualVary := resp.Header.Get("Vary")
|
|
|
+ if actualVary != expectedVary {
|
|
|
+ t.Fatalf(`Unexpected vary header value, got %q instead of %q`, actualVary, expectedVary)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
func TestBuildResponseWithoutCompressionHeader(t *testing.T) {
|
|
|
@@ -348,6 +366,12 @@ func TestBuildResponseWithoutCompressionHeader(t *testing.T) {
|
|
|
if actual != expected {
|
|
|
t.Fatalf(`Unexpected header value, got %q instead of %q`, actual, expected)
|
|
|
}
|
|
|
+
|
|
|
+ expectedVary := "Accept-Encoding"
|
|
|
+ actualVary := resp.Header.Get("Vary")
|
|
|
+ if actualVary != expectedVary {
|
|
|
+ t.Fatalf(`Unexpected vary header value, got %q instead of %q`, actualVary, expectedVary)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
func TestBuildResponseWithReaderBody(t *testing.T) {
|