Socket
Socket
Sign inDemoInstall

follow-redirects

Package Overview
Dependencies
Maintainers
3
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

follow-redirects - npm Package Compare versions

Comparing version 1.12.1 to 1.13.0

3

index.js

@@ -355,4 +355,5 @@ var url = require("url");

if (typeof this._options.beforeRedirect === "function") {
var responseDetails = { headers: response.headers };
try {
this._options.beforeRedirect.call(null, this._options);
this._options.beforeRedirect.call(null, this._options, responseDetails);
}

@@ -359,0 +360,0 @@ catch (err) {

{
"name": "follow-redirects",
"version": "1.12.1",
"version": "1.13.0",
"description": "HTTP and HTTPS modules that follow redirects.",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -31,3 +31,3 @@ ## Follow Redirects

```javascript
https.request({
const request = https.request({
host: 'bitly.com',

@@ -39,2 +39,3 @@ path: '/UHfDGO',

});
request.end();
```

@@ -67,4 +68,5 @@

options.maxRedirects = 10;
options.beforeRedirect = options => {
// Use this function to adjust the options upon redirecting,
options.beforeRedirect = (options, { headers }) => {
// Use this to adjust the request options upon redirecting,
// to inspect the latest response headers,
// or to cancel the request by throwing an error

@@ -71,0 +73,0 @@ if (options.hostname === "example.com") {

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