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

gofer

Package Overview
Dependencies
Maintainers
4
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gofer - npm Package Compare versions

Comparing version 3.5.4 to 3.5.5

6

CHANGELOG.md

@@ -0,1 +1,7 @@

### 3.5.5
* Ignore searchDomain for localhost and IP - **[@jkrems](https://github.com/jkrems)** [#80](https://github.com/groupon/gofer/pull/80)
- [`8cfb230`](https://github.com/groupon/gofer/commit/8cfb230673dafb6907c0fa7a6d5facc02980ae9b) **fix:** Ignore searchDomain for localhost and IP
### 3.5.4

@@ -2,0 +8,0 @@

27

lib/fetch.js

@@ -180,2 +180,20 @@ /*

var IPv4 = /^\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}$/;
function canApplySearchDomain(hostname) {
if (hostname === 'localhost') return false;
if (hostname[hostname.length - 1] === '.') return false;
// A hostname shouldn't contain ":" (IPv6 adddress) or be an IPv4 address
return hostname.indexOf(':') === -1 && !IPv4.test(hostname);
}
function buildHostname(hostname, searchDomain) {
if (!hostname || typeof hostname !== 'string') {
throw new Error('Invalid URI ' + JSON.stringify(hostname));
}
if (searchDomain && canApplySearchDomain(hostname)) {
return hostname + '.' + searchDomain + '.';
}
return hostname;
}
function fetchUrlObj(urlObj, options) {

@@ -208,11 +226,4 @@ if (options.baseUrl && typeof options.baseUrl === 'string') {

var hostname = urlObj.hostname;
if (!hostname || typeof hostname !== 'string') {
throw new Error('Invalid URI ' + JSON.stringify(hostname));
}
var hostname = buildHostname(urlObj.hostname, options.searchDomain);
if (options.searchDomain && hostname[hostname.length - 1] !== '.') {
hostname += '.' + options.searchDomain + '.';
}
var agent = getAgent(options, urlObj);

@@ -219,0 +230,0 @@ assign(agent.options, {

{
"name": "gofer",
"version": "3.5.4",
"version": "3.5.5",
"description": "A general purpose service client library",

@@ -5,0 +5,0 @@ "license": "BSD-3-Clause",

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