Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

preq

Package Overview
Dependencies
Maintainers
2
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

preq - npm Package Compare versions

Comparing version 0.4.2 to 0.4.3

6

index.js

@@ -163,7 +163,7 @@ "use strict";

// Check if we were redirected
if (self.options.uri !== response.request.uri) {
if (self.options.uri !== response.request.uri.href) {
if (!res.headers['content-location']) {
// Indicate the redirect via an injected Content-Location
// header
res.headers['content-location'] = response.request.uri;
res.headers['content-location'] = response.request.uri.href;
} else {

@@ -173,3 +173,3 @@ // Make sure that we resolve the returned content-location

res.headers['content-location'] = url.parse(response.request.uri)
.resolve(res.headers['content-location']).toString();
.resolve(res.headers['content-location']);
}

@@ -176,0 +176,0 @@ }

{
"name": "preq",
"version": "0.4.2",
"version": "0.4.3",
"description": "Yet another promising request wrapper",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -24,6 +24,5 @@ var preq = require('../index');

});
it('get google.com', function() {
it('get enwiki front page', function() {
return preq.get({
uri: 'http://google.com/',
retries: 2
uri: 'https://en.wikipedia.org/wiki/Main_Page',
})

@@ -33,2 +32,4 @@ .then(function(res) {

assert.equal(!!res.body, true);
// Make sure content-location is not set
assert.equal(!!res.headers['content-location'], false);
});

@@ -38,3 +39,3 @@ });

return preq.get({
uri: 'http://google.com',
uri: 'https://en.wikipedia.org/',
retries: 2

@@ -45,3 +46,4 @@ })

assert.equal(!!res.body, true);
assert.equal(!!res.headers['content-location'], true);
assert.equal(res.headers['content-location'],
'https://en.wikipedia.org/wiki/Main_Page');
});

@@ -48,0 +50,0 @@ });

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