- Use jq to cleanly remove encryptid SDK from package.json in Docker - Fix TypeScript strict mode errors in dashboard and assistant - Add .dockerignore to exclude node_modules from build context - Use project root as Docker build context for frontend - Fix Traefik routing: separate frontend/api/studio paths Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| .github | ||
| dist | ||
| src | ||
| .eslintignore | ||
| .eslintrc | ||
| .nvmrc | ||
| .prettierignore | ||
| CHANGELOG.md | ||
| LICENSE | ||
| README.md | ||
| package.json | ||
| tsconfig.json | ||
| vitest.config.ts | ||
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("www.example.com"); // 'www.example.com'
sanitizeUrl("mailto:hello@example.com"); // 'mailto:hello@example.com'
sanitizeUrl(
"https://example.com",
); // https://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'
// HTML encoded javascript:alert('XSS')
sanitizeUrl(
"javascript:alert('XSS')",
); // 'about:blank'
Testing
This library uses Vitest. All testing dependencies
will be installed upon npm install and the test suite can be executed with
npm test. Running the test suite will also run lint checks upon exiting.
npm test
To generate a coverage report, use npm run coverage.