Skip to content

Commit d27f639

Browse files
author
Avaer Kazmer
committed
Pass through baseUrl in Location.js
1 parent e2a63d5 commit d27f639

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/Location.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
const {EventEmitter} = require('events');
22
const url = require('url');
3-
const utils = require('./utils');
3+
4+
const {
5+
workerData: {
6+
args: {
7+
options: {
8+
baseUrl,
9+
},
10+
},
11+
},
12+
} = require('worker_threads');
413

514
class Location extends EventEmitter {
615
constructor(u) {
@@ -12,7 +21,7 @@ class Location extends EventEmitter {
1221
get href() { return this._url.href || ''; }
1322
set href(href) {
1423
const oldUrl = this._url;
15-
const newUrl = new url.URL(href, utils._getBaseUrl(this._url.href));
24+
const newUrl = new url.URL(href, baseUrl);
1625
this._url = newUrl;
1726
if (
1827
newUrl.origin !== oldUrl.origin ||

0 commit comments

Comments
 (0)