Navigation Menu

Skip to content

Commit

Permalink
chore: simplify variable (#1332)
Browse files Browse the repository at this point in the history
  • Loading branch information
godky authored and dead-horse committed Jun 3, 2019
1 parent 132c9ee commit 23f7f54
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/request.js
Expand Up @@ -287,11 +287,9 @@ module.exports = {
get URL() {
/* istanbul ignore else */
if (!this.memoizedURL) {
const protocol = this.protocol;
const host = this.host;
const originalUrl = this.originalUrl || ''; // avoid undefined in template string
try {
this.memoizedURL = new URL(`${protocol}://${host}${originalUrl}`);
this.memoizedURL = new URL(`${this.origin}${originalUrl}`);
} catch (err) {
this.memoizedURL = Object.create(null);
}
Expand Down

0 comments on commit 23f7f54

Please sign in to comment.