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

Add /brotli endpoint #20

Closed
wants to merge 1 commit into from
Closed

Add /brotli endpoint #20

wants to merge 1 commit into from

Conversation

gaul
Copy link
Contributor

@gaul gaul commented Aug 31, 2018

Parity with http://httpbin.org/

@ahmetb
Copy link
Owner

ahmetb commented Aug 31, 2018

Thanks for the PR, it looks good to me. So far we managed to keep this package vanilla-Go. This would be the first dependency that we accept.

I'm not entirely sure if we should start doing this. Do you have use case or do you think there's enough demand for /brotli? We already don't have 1:1 parity with httpbin.org right now (they definitely have more endpoints) so I need some convincing.

@gaul
Copy link
Contributor Author

gaul commented Aug 31, 2018

I want to add Brotli testing to compy to verify some behavior in barnacs/compy#47 and backfill our coverage. We currently use go-httpbin since this integrates most readily but I suppose we could stub out some tests which run against the httpbin.org service. I appreciate that taking a C dependency would impose a new requirement on all users and if this scopes out of the project currently I will understand.

@ahmetb
Copy link
Owner

ahmetb commented Aug 31, 2018

Can you potentially use httpbin.GetMux() (which is of type mux.Router) and register /brotli yourself in your code? This way you can extend go-httpbin.

If all you're testing is GET /brotli, then you probably don't even need go-httpbin in the first place.

@gaul
Copy link
Contributor Author

gaul commented Aug 31, 2018

This seems like a good workaround if this PR doesn't merge. However, we do use go-httpbin for all our other tests so it would be nice to have this mainline.

@ahmetb
Copy link
Owner

ahmetb commented Aug 31, 2018

The idea of cgo is scaring me a bit. The only external build dependency today is github.com/gorilla/mux and that's kind of needed to solve URL handling cleanly.

Since it's extensible and you can patch it with something like registerBrotli(mux) I'm tempted to close this –if the request comes up independently (and perhaps we have a Go-native Brotli implementation by then), I can accept.

Sorry about this.

@ahmetb ahmetb closed this Aug 31, 2018
@gaul
Copy link
Contributor Author

gaul commented Aug 31, 2018

I'm tempted to close this –if the request comes up independently (and perhaps we have a Go-native Brotli implementation by then), I can accept.

No worries and thank you for suggesting a workaround!

gaul added a commit to gaul/go-httpbin that referenced this pull request Sep 21, 2020
Parity with http://httpbin.org/ .  This is similar to ahmetb#20 but uses a
Go-only implementation translated by c2go:

https://github.com/andybalholm/brotli
@gaul gaul mentioned this pull request Sep 21, 2020
gaul added a commit to gaul/go-httpbin that referenced this pull request Sep 21, 2020
Parity with http://httpbin.org/ .  This is similar to ahmetb#20 but uses a
Go-only implementation translated by c2go:

https://github.com/andybalholm/brotli
ahmetb pushed a commit that referenced this pull request Sep 21, 2020
Parity with http://httpbin.org/ .  This is similar to #20 but uses a
Go-only implementation translated by c2go:

https://github.com/andybalholm/brotli
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.

2 participants