Commit Graph

7 Commits (d258aef50876eeea2f14d781b2f4417665cf6d27)

Author SHA1 Message Date
Jared Scheib ece512c631 Rename PrefixedRedirect to FlushingHandler & comment
It's not clear whether this code is necessary, but investigating
this was outside of the scope of this PR.
2018-04-20 18:40:09 -07:00
Jared Scheib 05128600c6 Refactor interceptingResponseWrite Flusher for clarity
Co-authored-by: Daniel Nelson <daniel.nelson@influxdb.com>
2018-04-20 18:40:09 -07:00
Jared Scheib 5ac2a3c063 Remove basepath var & arg from PrefixedRedirect 2018-04-20 18:40:09 -07:00
Jared Scheib 14cfc3f95c Fix logout link with basepath
Remove double-prefixing by removing the prefixing
logic of the InterceptingResponseWriter.

Fix the logout link route for its handler to not
include a basepath prefix.

Remove obsolete tests for prefixing redirector.

Co-authored-by: Michael Desa <mjdesa@gmail.com>
2018-04-20 16:58:41 -07:00
Chris Goller 3152471f7c Fix logger and redirector to be flushers allowing HTTP chunking 2017-10-26 17:38:20 -05:00
Tim Raymond befccf44d0 Fix infinite spinner with /chronograf basepath
When using a basepath of /chronograf, the app would present a
never-ending spinner when visiting the root route. This was because the
prefixingRedirector middleware which is responsible for appending the
basepath to redirects from downstream http.Handlers thought that the
prefix was already appended since it saw `/chronograf/v1`. In reality,
it should have produced a location like `/chronograf/chronograf/v1`.

The solution was to look beyond the first instance of a prefix and check
for the presence of another prefix to detect if a prefix was already
applied by a downstream handler.
2017-05-09 12:12:42 -07:00
Tim Raymond 49feb39e90 Add PrefixedRedirect function
The router that we use has a feature that will automatically redirect
routes in certain situations where it feels a trailing slash would be
appropriate. Because the underlying router is totally unaware of
upstream prefixing activity, the "Location" that it sends clients to is
incorrect because it doesn't have the prefix.

This introduces a middleware that catches any downstream 3XX class
responses and replaces the Location header with the prefixed version of
it, plus a trailing slash. It does this only when the prefix has not
been applied already by some downstream middleware.
2017-05-08 14:40:50 -07:00