Socket
Socket
Sign inDemoInstall

@braintree/sanitize-url

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@braintree/sanitize-url - npm Package Compare versions

Comparing version 4.0.1 to 4.1.0

.eslintignore

34

CHANGELOG.md

@@ -1,7 +0,10 @@

CHANGELOG
=========
# 4.1.0
- Add typescript types
# CHANGELOG
## 4.0.1
* Fix issue where urls with accented characters were incorrectly sanitized
- Fix issue where urls with accented characters were incorrectly sanitized

@@ -11,7 +14,9 @@ ## 4.0.0

_Breaking Changes_
* Protocol-less urls (ie: www.example.com) will be sanitised and passed on instead of sending out `about:blank` (Thanks @chawes13 #18)
- Protocol-less urls (ie: www.example.com) will be sanitised and passed on instead of sending out `about:blank` (Thanks @chawes13 #18)
## 3.1.0
* Trim whitespace from urls
- Trim whitespace from urls
## 3.0.0

@@ -21,18 +26,23 @@

* Replace blank strings with about:blank
* Replace null values with about:blank
- Replace blank strings with about:blank
- Replace null values with about:blank
## 2.1.0
* Allow relative urls to be sanitized
- Allow relative urls to be sanitized
## 2.0.2
* Sanitize malicious URLs that begin with `\s`
- Sanitize malicious URLs that begin with `\s`
## 2.0.1
* Sanitize malicious URLs that begin with %20
- Sanitize malicious URLs that begin with %20
## 2.0.0
* sanitize data: urls
- sanitize data: urls
## 1.0.0
* sanitize javascript: urls
- sanitize javascript: urls
{
"name": "@braintree/sanitize-url",
"version": "4.0.1",
"version": "4.1.0",
"description": "A url sanitizer",
"main": "index.js",
"main": "dist/index.js",
"types": "index.d.ts",
"author": "",
"scripts": {
"lint": "eslint .",
"pretest": "npm run lint",
"test": "mocha"
"prepublishOnly": "npm run build",
"prebuild": "prettier --write .",
"build": "tsc --declaration",
"lint": "eslint --ext js,ts .",
"posttest": "npm run lint",
"test": "jest"
},

@@ -23,7 +27,19 @@ "repository": {

"devDependencies": {
"@types/jest": "^26.0.4",
"chai": "^4.1.0",
"eslint": "^6.2.2",
"eslint-config-braintree": "^4.0.0",
"mocha": "^6.2.0"
"eslint": "^7.4.0",
"eslint-config-braintree": "^5.0.0-typescript-prep-rc.17",
"jest": "^26.1.0",
"prettier": "^2.0.5",
"ts-jest": "^26.1.2",
"typescript": "^3.9.6"
},
"jest": {
"preset": "ts-jest",
"globals": {
"ts-jest": {
"tsConfig": "src/__tests__/tsconfig.json"
}
}
}
}

@@ -12,12 +12,12 @@ # sanitize-url

```js
var sanitizeUrl = require('@braintree/sanitize-url').sanitizeUrl;
var sanitizeUrl = require("@braintree/sanitize-url").sanitizeUrl;
sanitizeUrl('https://example.com'); // 'https://example.com'
sanitizeUrl('http://example.com'); // 'http://example.com'
sanitizeUrl('www.example.com'); // 'www.example.com'
sanitizeUrl('mailto:hello@example.com'); // 'mailto:hello@example.com'
sanitizeUrl("https://example.com"); // 'https://example.com'
sanitizeUrl("http://example.com"); // 'http://example.com'
sanitizeUrl("www.example.com"); // 'www.example.com'
sanitizeUrl("mailto:hello@example.com"); // 'mailto:hello@example.com'
sanitizeUrl('javascript:alert(document.domain)'); // 'about:blank'
sanitizeUrl('jAvasCrIPT:alert(document.domain)'); // 'about:blank'
sanitizeUrl(decodeURIComponent('JaVaScRiP%0at:alert(document.domain)')); // 'about:blank'
sanitizeUrl("javascript:alert(document.domain)"); // 'about:blank'
sanitizeUrl("jAvasCrIPT:alert(document.domain)"); // 'about:blank'
sanitizeUrl(decodeURIComponent("JaVaScRiP%0at:alert(document.domain)")); // 'about:blank'
```

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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