-
- Downloads
Improve and standardize error handling (#135)
Standardize on structured JSON error responses everywhere we can, with only one exception where the error is a warning for humans to read. Fixes #108 by adding a check to every request in the test suite to ensure that errors are never served with a Content-Type that might enable XSS or other vulnerabilities. While we're at it, continue refining the test suite and further adopting some of the testing helpers added in #131.
Showing
- httpbin/handlers.go 106 additions, 93 deletionshttpbin/handlers.go
- httpbin/handlers_test.go 52 additions, 114 deletionshttpbin/handlers_test.go
- httpbin/helpers.go 12 additions, 2 deletionshttpbin/helpers.go
- httpbin/httpbin.go 1 addition, 0 deletionshttpbin/httpbin.go
- httpbin/middleware.go 6 additions, 0 deletionshttpbin/middleware.go
- httpbin/middleware_test.go 39 additions, 0 deletionshttpbin/middleware_test.go
- httpbin/options.go 14 additions, 1 deletionhttpbin/options.go
- httpbin/responses.go 6 additions, 0 deletionshttpbin/responses.go
- internal/testing/assert/assert.go 18 additions, 0 deletionsinternal/testing/assert/assert.go
Loading
Please register or sign in to comment