-
Notifications
You must be signed in to change notification settings - Fork 126
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
Tracking compatibility with original httpbin #91
Comments
```console # before: httpbingo lacks the "method" field but httpbin.org has it $ curl -s https://httpbingo.org/anything | jq .method 9:31PM null $ curl -s https://httpbin.org/anything | jq .method "GET" # after: httpbingo has the method field! $ curl -s http://0.0.0.0:8080/anything | jq .method "GET" ``` This was mentioned in #6, but then not listed in #91 - I took the highly technical testing approach of adding a test for `Method` anywhere in `handlers_test.go` that mentioned `Args`; do you desire more tests? fewer tests? - Anywhere else I should add this field that I didn't already? For what it's worth, I discovered this when working on upgrading the testing for our [httpsnippet library](https://github.com/readmeio/httpsnippet); I wanted to use `go-httpbin` but our tests expect the method field to be present in the responses
I got a different response
|
Good catch, thanks. I think we should include both Content-Length and Content-Type to match original httpbin. Are you interested in opening an issue for that specific feature and/or opening a pull request to implement it? (An interesting question is what should happen if the request specifies different, incorrect values for those two headers; might be worth seeing how httpbin.org handles those cases.) But, to be clear, go-httpbin will continue to serialize header values (and form values and any other “zero or more” values inherent to HTTP) as JSON arrays for consistency, where original httpbin serializes them as single scalar values, arrays, or comma-separated strings, depending on the endpoint and incoming request parameters. |
it should be noted that
and this implementation does not. As per https://www.rfc-editor.org/rfc/rfc2324#section-2.3.2 this is strictly speaking in compliance with the RFC (due to the use of MAY versus MUST), but it is a difference in behavior and as such I must point it out. |
@bleggett please report that as a separate issue (or skip the separate issue and open a pull request to fix it). |
Let's use this as a place to track compatibility with original httpbin:
Should fix
Fixed
data:
URIs #90Won't fix
Expect: 100-continue
with empty request bodyThe text was updated successfully, but these errors were encountered: