-
- Downloads
Rework JSON serialization (#94)
Instead of serializing JSON to a temporary slice of bytes before writing to the response, instead write directly to the response. Also, pretty-print JSON responses for better readability (and to match httpbin). Note: With this change, we rely much more on the underlying net/http server's implicit handling of the Content-Length header. One notable side effect of this is that responses to HEAD requests no longer include a Content-Length.
Showing
- httpbin/handlers.go 58 additions, 73 deletionshttpbin/handlers.go
- httpbin/handlers_test.go 20 additions, 18 deletionshttpbin/handlers_test.go
- httpbin/helpers.go 13 additions, 3 deletionshttpbin/helpers.go
- httpbin/httpbin.go 3 additions, 12 deletionshttpbin/httpbin.go
- httpbin/middleware.go 1 addition, 1 deletionhttpbin/middleware.go
Loading
Please register or sign in to comment