You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
6 years ago | |
|---|---|---|
| .. | ||
| test | 6 years ago | |
| .nvmrc | 6 years ago | |
| .travis.yml | 6 years ago | |
| CHANGELOG.md | 6 years ago | |
| LICENSE | 6 years ago | |
| README.md | 6 years ago | |
| index.js | 6 years ago | |
| package.json | 6 years ago | |
README.md
sanitize-url
Installation
npm install -S @braintree/sanitize-url
Usage
var sanitizeUrl = require('@braintree/sanitize-url').sanitizeUrl;
sanitizeUrl('https://example.com'); // 'https://example.com'
sanitizeUrl('http://example.com'); // 'http://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'