We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 095f531 commit 23742e3Copy full SHA for 23742e3
src/vanilla/browserLocationConfig.ts
@@ -1,4 +1,5 @@
1
-/** @internalapi @module vanilla */ /** */
+/** @internalapi @module vanilla */
2
+/** */
3
import { isDefined, isUndefined } from '../common/predicates';
4
import { LocationConfig } from '../common/coreservices';
5
@@ -42,8 +43,11 @@ export class BrowserLocationConfig implements LocationConfig {
42
43
44
private getBaseHref() {
45
const baseTag: HTMLBaseElement = document.getElementsByTagName('base')[0];
- if (!baseTag || !baseTag.href) return location.pathname || '/';
46
- return baseTag.href.replace(/^(https?:)?\/\/[^/]*/, '');
+ if (baseTag && baseTag.href) {
47
+ return baseTag.href.replace(/^(https?:)?\/\/[^/]*/, '');
48
+ }
49
+
50
+ return this._isHtml5 ? '/' : location.pathname || '/';
51
}
52
53
dispose() {}
0 commit comments