Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

axios-method-override

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

axios-method-override - npm Package Compare versions

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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc