Skip to content

Commit

Permalink
fix: concatenate request URL
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Apr 26, 2019
1 parent 2034b59 commit 41a652b
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/classes/Agent.js
@@ -1,6 +1,5 @@
// @flow

import url from 'url';
import Logger from '../Logger';
import type {
AgentType,
Expand Down Expand Up @@ -31,12 +30,7 @@ class Agent {
}

addRequest (request: *, configuration: *) {
const requestUrl = url.format({
hostname: configuration.hostname || configuration.host,
pathname: request.path,
port: configuration.port === 80 ? undefined : configuration.port,
protocol: this.protocol
});
const requestUrl = this.protocol + '//' + configuration.hostname + (configuration.port === 80 || configuration.port === 443 ? '' : ':' + configuration.port) + request.path;

if (this.mustUrlUseProxy(requestUrl)) {
if (this.protocol === 'http:') {
Expand Down

0 comments on commit 41a652b

Please sign in to comment.