2
0
mirror of https://github.com/tenrok/axios.git synced 2026-06-05 16:42:32 +03:00

Preserve HTTP method when following redirect (#1758)

Resolves #1158

This modifies http.js to uppercase the HTTP method, similar to xhr.js, before passing the request off to the transport. This causes follow-redirects to preserve the HTTP method when automatically making a request to the next URL.
This commit is contained in:
Rikki Gibson
2018-08-27 08:26:38 -07:00
committed by Khaled Garbaya
parent 9005a54a8b
commit 21ae22dbd3
2 changed files with 27 additions and 1 deletions
+1 -1
View File
@@ -83,7 +83,7 @@ module.exports = function httpAdapter(config) {
var options = {
path: buildURL(parsed.path, config.params, config.paramsSerializer).replace(/^\?/, ''),
method: config.method,
method: config.method.toUpperCase(),
headers: headers,
agent: agent,
auth: auth