Skip to content

Commit

Permalink
refactor: Use updated URL types
Browse files Browse the repository at this point in the history
  • Loading branch information
d-goog committed Feb 16, 2024
1 parent 8490f24 commit 689765a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/gaxios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function skipProxy(url: string | URL) {
return false;
}
const noProxyUrls = noProxyEnv.split(',');
const parsedURL = url instanceof URL ? url : new URL(url);
const parsedURL = new URL(url);
return !!noProxyUrls.find(url => {
if (url.startsWith('*.') || url.startsWith('.')) {
url = url.replace(/^\*\./, '.');
Expand Down Expand Up @@ -237,9 +237,7 @@ export class Gaxios {
}

if (opts.baseURL) {
const base =
opts.baseURL instanceof URL ? opts.baseURL : new URL(opts.baseURL);
opts.url = new URL(opts.url.toString(), base);
opts.url = new URL(opts.url, opts.baseURL);
}

opts.paramsSerializer = opts.paramsSerializer || this.paramsSerializer;
Expand Down

0 comments on commit 689765a

Please sign in to comment.