Skip to content

Commit 23f7f54

Browse files
godkydead-horse
authored andcommitted
chore: simplify variable (#1332)
1 parent 132c9ee commit 23f7f54

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/request.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -287,11 +287,9 @@ module.exports = {
287287
get URL() {
288288
/* istanbul ignore else */
289289
if (!this.memoizedURL) {
290-
const protocol = this.protocol;
291-
const host = this.host;
292290
const originalUrl = this.originalUrl || ''; // avoid undefined in template string
293291
try {
294-
this.memoizedURL = new URL(`${protocol}://${host}${originalUrl}`);
292+
this.memoizedURL = new URL(`${this.origin}${originalUrl}`);
295293
} catch (err) {
296294
this.memoizedURL = Object.create(null);
297295
}

0 commit comments

Comments
 (0)