axios-method-override
Advanced tools
Comparing version 1.0.1 to 1.0.2
12
index.js
@@ -1,10 +0,12 @@ | ||
'use strict'; | ||
"use strict"; | ||
var assign = require("object-assign"); | ||
module.exports = function(axios) { | ||
axios.interceptors.request.use(function(config) { | ||
var method = config.method.toUpperCase(); | ||
if (method === 'PUT' || method === 'DELETE' || method === 'PATCH') { | ||
config.headers['X-HTTP-Method-Override'] = method; | ||
config.method = 'post'; | ||
config.params._method = method; | ||
if (method === "PUT" || method === "DELETE" || method === "PATCH") { | ||
config.headers["X-HTTP-Method-Override"] = method; | ||
config.method = "post"; | ||
config.params = assign({}, config.params, { _method: method }); | ||
} | ||
@@ -11,0 +13,0 @@ return config; |
{ | ||
"name": "axios-method-override", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "axios request method override plugin", | ||
@@ -13,3 +13,9 @@ "main": "index.js", | ||
}, | ||
"keywords": ["axios", "http", "interceptor", "method", "method-override"], | ||
"keywords": [ | ||
"axios", | ||
"http", | ||
"interceptor", | ||
"method", | ||
"method-override" | ||
], | ||
"author": "Jacob Buck <buck.jacob@gmail.com>", | ||
@@ -20,3 +26,6 @@ "license": "MIT", | ||
}, | ||
"homepage": "https://github.com/jacobbuck/axios-method-override#readme" | ||
"homepage": "https://github.com/jacobbuck/axios-method-override#readme", | ||
"dependencies": { | ||
"object-assign": "^4.1.1" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2603
14
1
+ Addedobject-assign@^4.1.1
+ Addedobject-assign@4.1.1(transitive)