Open moosterhof opened 3 years ago
Most HTTP clients (including web browsers) act like this. Generally the 307 or 308 codes are used to indicate that the request should be retried with the original verb and payload. (see https://github.com/seanmonstar/reqwest/issues/912 for the reqwest-specific comment)
Bringing this up with Hashicorp might be best, although I expect they'll just say to use the v1
path since then your code is guaranteed not to break when upgrading Vault. Otherwise, this could be handled by disabling reqwest's redirect handling and doing it manually.
Hi! I've been using this for a small project, and I notice that when Vault returns a 301, my POST (or PUT) verb turns into a GET verb. So it seems when following 301's the verb is reset.
You can test this by doing an API call to
/sys/tools/random
, Vault will rewrite with a 301 to/v1//sys/tools/random
and to/v1/sys/tools/random
and in the process thePOST
verb is lost.