Commit Graph

7 Commits (c173f3f586b22528ddf40e84c5438ea96fc5671d)

Author SHA1 Message Date
Jared Scheib 9904575680 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 c23d75396f Refactor interceptingResponseWrite Flusher for clarity
Co-authored-by: Daniel Nelson <daniel.nelson@influxdb.com>
2018-04-20 18:40:09 -07:00
Jared Scheib a5adbdfc8d Remove basepath var & arg from PrefixedRedirect 2018-04-20 18:40:09 -07:00
Jared Scheib 68d9d6610b 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 832589f9b9 Fix logger and redirector to be flushers allowing HTTP chunking 2017-10-26 17:38:20 -05:00
Tim Raymond b7bb23720f 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 5cf21f6cbd 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