Skip to content

Commit

Permalink
try fix subdomain discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
h.u.g.u.rp committed Oct 10, 2023
1 parent 95d0fdd commit a522148
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ export default class R4Radio extends HTMLElement {
get slugInfo() {
const pathname = window.location.pathname.split("/")[1];
const subdomains = window.location.host
.replace("." + this.hostname, "")
.split(".");
.replace(this.hostname, "")
.split(".")
.filter((sub) => !!sub);
const wildcard = subdomains[subdomains.length - 1];
const subdomain = this.hostname === wildcard ? null : wildcard;
return {
Expand Down

1 comment on commit a522148

@vercel
Copy link

@vercel vercel bot commented on a522148 Oct 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.