-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTTP Server should handle standby redirects #16
Conversation
@@ -62,8 +63,12 @@ func parseRequest(r *http.Request, out interface{}) error { | |||
|
|||
// request is a helper to perform a request and properly exit in the | |||
// case of an error. | |||
func request(core *vault.Core, w http.ResponseWriter, r *logical.Request) (*logical.Response, bool) { | |||
func request(core *vault.Core, w http.ResponseWriter, reqURL *url.URL, r *logical.Request) (*logical.Response, bool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of doing url.URL lets just pass the full http.Request
object through. We don't know when we might need it in the future and it actually makes it easier to call as a client: w, r
is pretty esa.
One comment but LGTM,good catch. |
@mitchellh Good call. Updated. |
HTTP Server should handle standby redirects
@mitchellh I started the client redirect but ran into some issues. The main one is that the io.Reader gets consumed in the original request. Thoughts? |
@armon Hm, if it doesn't work, we can always make a special response type that we catch at the API layer and re-send it. |
…e_subnets [SRE-2000] Handle Multiple Subnets In VPC Peering Module
Bring over PSIRT-37 changes from ENT
This PR changes the HTTP server to generate 307 redirects when in standby mode. 307 is used instead of 302 because 302 causes the HTTP METHOD to switch to GET regardless of the original method.
Outstanding issues:
/cc: @mitchellh