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

Need pointer to implement CloseNotifier #63

Merged
merged 3 commits into from
Jan 25, 2018

Conversation

juliens
Copy link
Contributor

@juliens juliens commented Jan 25, 2018

GzipResponseWriterWithCloseNotify doesn't implement CloseNotifier, but *GzipResponseWriterWithCloseNotify does.

Fix the tests to really verify with a request that accept gzip.

@tmthrgd
Copy link
Contributor

tmthrgd commented Jan 25, 2018

You’d be better off changing CloseNotify to accept a value reciever instead. Doing that imposes no overhead, whereas this PR would add an extra allocation per request.

Copy link
Contributor

@jprobinson jprobinson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this! I've got one small style request.

gzip_test.go Outdated
@@ -325,17 +325,35 @@ func TestFlushBeforeWrite(t *testing.T) {
}

func TestImplementCloseNotifier(t *testing.T) {
request := &http.Request{}
request.Header = http.Header{}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind using https://golang.org/pkg/net/http/httptest/#NewRequest here instead of building the request and header in 2 lines?

@jprobinson
Copy link
Contributor

🌭 🍕 thanks!!

@jprobinson jprobinson merged commit 289a3b8 into nytimes:master Jan 25, 2018
drewbailey added a commit to hashicorp/nomad that referenced this pull request Oct 7, 2019
This version of gziphandler includes a fix that fixes GzipResponseWriter
to implement CloseNotifier

nytimes/gziphandler#63
drewbailey added a commit to hashicorp/nomad that referenced this pull request Oct 15, 2019
This version of gziphandler includes a fix that fixes GzipResponseWriter
to implement CloseNotifier

nytimes/gziphandler#63
drewbailey added a commit to hashicorp/nomad that referenced this pull request Oct 25, 2019
This version of gziphandler includes a fix that fixes GzipResponseWriter
to implement CloseNotifier

nytimes/gziphandler#63
drewbailey added a commit to hashicorp/nomad that referenced this pull request Oct 30, 2019
This version of gziphandler includes a fix that fixes GzipResponseWriter
to implement CloseNotifier

nytimes/gziphandler#63
drewbailey added a commit to hashicorp/nomad that referenced this pull request Nov 1, 2019
This version of gziphandler includes a fix that fixes GzipResponseWriter
to implement CloseNotifier

nytimes/gziphandler#63
drewbailey added a commit to hashicorp/nomad that referenced this pull request Nov 4, 2019
This version of gziphandler includes a fix that fixes GzipResponseWriter
to implement CloseNotifier

nytimes/gziphandler#63
drewbailey added a commit to hashicorp/nomad that referenced this pull request Nov 5, 2019
This version of gziphandler includes a fix that fixes GzipResponseWriter
to implement CloseNotifier

nytimes/gziphandler#63
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants