Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
uri-template-lite
Advanced tools
URI Template RFC 6570 expansion and extraction.
npm install uri-template-lite
var UriTemplate = require("uri-template-lite")
// Call `expand` directly
var data = {"domain":"example.com", "user":"fred", "query":"mycelium"}
UriTemplate.expand("http://{domain}/~{user}/foo{?query,number}", data)
// Returns http://example.com/~fred/foo?query=mycelium
// ..or use `Template` constructor
var template = new UriTemplate("http://{domain}/~{user}/foo{?query,number}")
template.expand({"domain":"example.com", "user":"fred", "query":"mycelium", "number": 3})
// Returns http://example.com/~fred/foo?query=mycelium&number=3
// Extract variables
template.match("http://example.com/~fred/foo?query=mycelium&number=3")
// Returns {"domain":"example.com", "user":"fred", "query":"mycelium", "number": "3"}
template.match("http://other.com/?query=mycelium")
// Returns null
This implementation tries to do a best effort template expansion and leaves erroneous expressions in the returned URI instead of throwing errors. So for example, the incorrect expression {unclosed will return {unclosed as output.
It should work IE6 and up but automated testing is currently broken.
browser-upgrade-lite
package
or other ES5 polyfill.escape
should be patched to remove non-standard 2nd param,
browser-upgrade-lite
does that.GitHub repo |
npm package |
URI Template RFC 6570 and
Tests |
Coveralls coverage
Buy Me A Tea
Copyright (c) 2014-2022 Lauri Rooden <lauri@rooden.ee>
The MIT License
FAQs
URI Template [RFC 6570] expansion and extraction
We found that uri-template-lite demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.