Skip to content

Commit

Permalink
added fallback for missing search in URLs
Browse files Browse the repository at this point in the history
when building URLs in some contexts (like Cypress), the `search` property is null, which gets tacked on as the string `"null"` to the path.
  • Loading branch information
nibblesnbits authored and jm-mailosaur committed Apr 17, 2023
1 parent 2a1a7db commit f12e8bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class Request {
const spread = Object.assign({}, options, {
protocol: urlResult.protocol,
hostname: urlResult.hostname,
path: urlResult.pathname + urlResult.search
path: urlResult.pathname + (urlResult.search || '')
});
const req = https.request(spread, (res) => {
const data = [];
Expand Down

0 comments on commit f12e8bd

Please sign in to comment.