Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix nil panic in confighttp #5628

Merged
merged 7 commits into from
Jul 19, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix unit test
Signed-off-by: Ziqi Zhao <[email protected]>
  • Loading branch information
fatsheep9146 committed Jul 18, 2022
commit c7567ac3f92440d9f26c8a3fdfa35b0705977a44
3 changes: 2 additions & 1 deletion config/confighttp/compression_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ func TestHTTPContentCompressionRequestWithNilBody(t *testing.T) {
}

func TestHTTPContentCompressionCopyError(t *testing.T) {
testBody := bytes.NewBuffer([]byte("test"))
copyErrorCompressRoundTripper := &compressRoundTripper{
RoundTripper: http.DefaultTransport,
compressionType: "copyFailed",
Expand All @@ -273,7 +274,7 @@ func TestHTTPContentCompressionCopyError(t *testing.T) {
}))
defer server.Close()

req, err := http.NewRequest("GET", server.URL, nil)
req, err := http.NewRequest("GET", server.URL, testBody)
require.NoError(t, err, "failed to create request to test handler")

client := http.Client{}
Expand Down