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.
hyperdirect
Advanced tools
Follow redirects for hyperquest GET requests. Process all other requests exactly as normal.
$ npm install hyperdirect
//basic usage
var request = require('hyperquest').request;
request('https://github.com/ForbesLindesay/hyperdirect/archive/master.tar.gz')
.pipe(require('fs').createWriteStream(__dirname + '/hyperdirect.tar.gz'));
//moderate usage
var request = require('hyperquest')(2/* Max Redirects to follow, defaults to 10 */);
request('https://github.com/ForbesLindesay/hyperdirect/archive/master.tar.gz')
.pipe(require('fs').createWriteStream(__dirname + '/hyperdirect.tar.gz'));
//advanced usage
var hyperdirect = require('hyperdirect')(5, require('hyperquest'));
Returns a new function with the same API as hyperquest but which follows redirects for GET requests. Both maxRedirects
and subquest
are optional and can be in either order.
If provided, subquest
should be a function which matches the API of hyperquest or an object of the form {request: hyperquest}
where hyperquest
is a function matching the API of hyperquest.
maxRedirects
will default to 10
. Once the request has been redirected more times than that it will give up and throw an error. The error has a res
and statusCode
property set to the apropriate properties from the last request made.
The returned stream will emit redirect
events with the response of any request that results in another redirect. This means you could trace the path something a request took by doing:
require('hyperdirect')(100)(url)
.on('redirect', function (res) {
console.log('REDIRECT ' + res.statusCode + ': ' + res.headers.location);
})
.on('response', function (res) {
console.log('FINAL URL: ' + res.url);
});
Follows exactly the same API as hyperquest but automatically follows up to 10 redirects for GET requests. It's the same as what you get by calling hyperdirect()
.
MIT
FAQs
Follow redirects for hyperquest GET requests
We found that hyperdirect 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.