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 5.0.0 to 5.0.1

.github/CODEOWNERS

6

CHANGELOG.md

@@ -0,3 +1,9 @@

# 5.0.1
- Fix issue where certain safe characters were being filtered out (#31 thanks @akirchmyer)
# 5.0.0
_Breaking Changes_
- Sanitize vbscript urls (thanks @vicnicius)

@@ -4,0 +10,0 @@

2

dist/index.js

@@ -5,3 +5,3 @@ "use strict";

var invalidProtocolRegex = /^(%20|\s)*(javascript|data|vbscript)/im;
var ctrlCharactersRegex = /[^\x20-\x7EÀ-ž]/gim;
var ctrlCharactersRegex = /[\u0000-\u001F\u007F-\u009F]/gim;
var urlSchemeRegex = /^([^:]+):/gm;

@@ -8,0 +8,0 @@ var relativeFirstCharacters = [".", "/"];

{
"name": "@braintree/sanitize-url",
"version": "5.0.0",
"version": "5.0.1",
"description": "A url sanitizer",

@@ -27,10 +27,10 @@ "main": "dist/index.js",

"devDependencies": {
"@types/jest": "^26.0.13",
"@types/jest": "^26.0.19",
"chai": "^4.1.0",
"eslint": "^7.8.1",
"eslint": "^7.17.0",
"eslint-config-braintree": "^5.0.0-typescript-prep-rc.18",
"jest": "^26.4.2",
"prettier": "^2.1.1",
"ts-jest": "^26.3.0",
"typescript": "^3.9.7"
"jest": "^26.6.3",
"prettier": "^2.2.1",
"ts-jest": "^26.4.4",
"typescript": "^4.1.3"
},

@@ -37,0 +37,0 @@ "jest": {

@@ -171,2 +171,14 @@ /* eslint-disable no-script-url */

it("does not strip harmless unicode characters", () => {
expect(sanitizeUrl("www.example.com/лот.рфшишкиü–")).toBe(
"www.example.com/лот.рфшишкиü–"
);
});
it("should strip out control chars", () => {
expect(sanitizeUrl("www.example.com/\u0000\u001F\x00\x1F")).toBe(
"www.example.com/"
);
});
it("replaces blank urls with about:blank", () => {

@@ -173,0 +185,0 @@ expect(sanitizeUrl("")).toBe("about:blank");

const invalidProtocolRegex = /^(%20|\s)*(javascript|data|vbscript)/im;
const ctrlCharactersRegex = /[^\x20-\x7EÀ-ž]/gim;
const ctrlCharactersRegex = /[\u0000-\u001F\u007F-\u009F]/gim;
const urlSchemeRegex = /^([^:]+):/gm;

@@ -4,0 +4,0 @@ const relativeFirstCharacters = [".", "/"];

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