Skip to content

Commit d8474fd

Browse files
committed
Allow IPv6 localhost
1 parent e8d6330 commit d8474fd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

obs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
const obsSrc = document.currentScript;
1616

1717
if (!obsSrc || obsSrc.src || (obsSrc.type && obsSrc.type.toLowerCase() === 'module')) {
18-
if (/^(localhost|127\.0\.0\.1)$/.test(location.hostname) === false) {
18+
if (/^(localhost|127\.0\.0\.1|::1)$/.test(location.hostname) === false) {
1919
console.warn(
2020
'[obs] Skipping: must be an inline, classic <script> in <head>.',
2121
obsSrc ? (obsSrc.src ? 'src=' + obsSrc.src : 'type=' + obsSrc.type) : 'type=module'

0 commit comments

Comments
 (0)