Commit Graph

1 Commits (c845f4a8dabaca66b1fa0278f83d3fb31c4d4288)

Author SHA1 Message Date
Tim Raymond 206a6bba33 Bypass URLPrefixer if http.Flusher is unavailable
In certain situations, the http.ResponseWriter passed to the URLPrefixer
may not be an http.Flusher. A simple case where this may occur is if the
Prefixer has been wrapped up in a middleware where the above middleware
wraps the ResponseWriter in a ResponseWriter that doesn't implement the
Flush method.

Previously, the Prefixer would error, which would cause the request to
fail with a 500. Instead, the condition is logged and the request is
passed unmodified to the next middleware in the chain. This effectively
disables prefixing for requests where the above ResponseWriter is not an
http.Flusher.

Misc. Changes
=============

- Some tests for "builders" were moved to server/builders_test.go to
  follow with convention. We've been naming files after different things
  under test and leaving the file matching the package name for support
  objects-in this case a mock logger was added to that file.
2017-04-04 10:33:14 -04:00