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

vxe-ajax

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vxe-ajax - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

16

index.js
import { XEAjax } from './src/constructor'
import { isFormData } from './src/util'
import ajax from './src/ajax'

@@ -7,17 +6,2 @@

// set request header
XEAjax.oninterceptor = function (request, next) {
if (!isFormData(request.method === 'get' ? request.params : request.body)) {
if (request.bodyMode === 'json') {
request.setHeader('Content-Type', 'application/json; charset=utf-8')
} else {
request.setHeader('Content-Type', 'application/x-www-form-urlencoded')
}
}
if (request.crossOrigin) {
request.setHeader('X-Requested-With', 'XMLHttpRequest')
}
next()
}
/**

@@ -24,0 +8,0 @@ * Install Vue plugin

2

package.json
{
"name": "vxe-ajax",
"version": "1.0.2",
"version": "1.0.3",
"description": "vxe-ajax 使用Promise提供便捷函数式调用api",

@@ -5,0 +5,0 @@ "main": "index.js",

import { XEAjaxRequest } from './request'
import { XEAjaxResponse } from './response'
import { XEPromise } from './promise'
import { isFunction, isUndefined, eachObj } from './util'
import { isFunction, isFormData, isUndefined, eachObj } from './util'

@@ -189,1 +189,16 @@ var setupInterceptors = []

}
// set request header
XEAjax.oninterceptor = function (request, next) {
if (!isFormData(request.method === 'get' ? request.params : request.body)) {
if (request.bodyMode === 'json') {
request.setHeader('Content-Type', 'application/json; charset=utf-8')
} else {
request.setHeader('Content-Type', 'application/x-www-form-urlencoded')
}
}
if (request.crossOrigin) {
request.setHeader('X-Requested-With', 'XMLHttpRequest')
}
next()
}
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