-
Will McCutchen authored
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.
Will McCutchen authoredInstead 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.