mailgun.js
Advanced tools
Comparing version 3.1.0 to 3.1.1
/*! MIT License © Sindre Sorhus */ | ||
/*! mailgun.js v3.1.0 */ | ||
/*! mailgun.js v3.1.1 */ |
import Btoa from 'btoa'; | ||
import merge from 'lodash.merge'; | ||
import urljoin from 'url-join'; | ||
import ky from 'ky-universal'; | ||
@@ -48,8 +45,15 @@ | ||
const basic = Btoa(`${this.username}:${this.key}`); | ||
const headers = merge({ | ||
Authorization: `Basic ${basic}` | ||
}, this.headers, options?.headers); | ||
const headers = { | ||
Authorization: `Basic ${basic}`, | ||
...this.headers, | ||
...options?.headers | ||
}; | ||
delete options?.headers; | ||
if (!headers['Content-Type']) { | ||
// for form-data it will be Null so we need to remove it | ||
delete headers['Content-Type']; | ||
} | ||
const params = { ...options }; | ||
@@ -93,3 +97,2 @@ | ||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, | ||
// json: data, | ||
body: data, | ||
@@ -119,3 +122,3 @@ ...options | ||
const formData: FormData = new (this.formData as any)(); | ||
const options: any = { | ||
const params: any = { | ||
headers: { 'Content-Type': null } | ||
@@ -154,3 +157,3 @@ }; | ||
return this.command('post', url, formData, options); | ||
return this.command('post', url, formData, params); | ||
} | ||
@@ -157,0 +160,0 @@ |
{ | ||
"name": "mailgun.js", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"main": "dist/mailgun.js", | ||
@@ -39,3 +39,2 @@ "types": "dist/index.d.ts", | ||
"lodash.map": "^4.6.0", | ||
"lodash.merge": "^4.6.2", | ||
"lodash.partialright": "^4.2.1", | ||
@@ -55,3 +54,2 @@ "url": "^0.11.0", | ||
"@types/lodash.map": "^4.6.13", | ||
"@types/lodash.merge": "^4.6.6", | ||
"@types/lodash.partialright": "^4.2.6", | ||
@@ -58,0 +56,0 @@ "@types/mocha": "^8.2.0", |
Sorry, the diff of this file is too big to display
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
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
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
12
29
2201392
3257
1
6
- Removedlodash.merge@^4.6.2
- Removedlodash.merge@4.6.2(transitive)