Skip to content

Commit 82dd08e

Browse files
authored
Merge pull request #278 from Neradoc/accept-any-local
Allow any address in .local for the web workflow
2 parents bcfba25 + 3323abc commit 82dd08e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

js/common/utilities.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,9 @@ function makeUrl(url, extraParams = {}) {
4141
return new URL(oldUrl) + buildHash(urlParams);
4242
}
4343

44-
// Check if the current url is a valid CircuitPython Web Workflow local device name
44+
// Check for any local MDNS name, not limited to Circuitpython default names
4545
function isMdns() {
46-
// Check for cpy-XXXXXX.local (and optionally cpy-XXXXXX-###.local for mDNS name resolution)
47-
return location.hostname.search(/cpy-[0-9a-f]{6}(?:-[0-9]+)?.local/gi) == 0;
46+
return location.hostname.endsWith(".local");
4847
}
4948

5049
// Check if the current url is an IP address

0 commit comments

Comments
 (0)