You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see how this can be confusing… .localhost is considered the TLD (Top Level Domain, e.g. .com), which makes my-subdomain.localhost the domain, and there is no subdomain.
I see. Well, in my mind, in x.localhost, x is always considred to be a subdomain and localhost is domain. I have no earthly idea if it is correct with the general understanding of how domains work for internet addresses. Do you think you could implement a workaround for localhosts in particular? If need be, maybe driven by some additional parameter passed to subdomain()?
If you're interested in tackling this allow me to give a few pointers:
the change needs to be backward compatible
the change may not change a function's signature to diverge from how other function signatures look
the change needs to be configurable, as the next person may need the same for lolcat (because they were bored by localhost or something - what do I know, humans and domains - funny business ;))
So I'd probably add something like URI.forceDomains = [ 'localhost' ] and then make .tld() and .domain() work with that. that would solve the second and third point. In order to solve the first point we'd consider URI.forceDomains = [] the default config.
subdomain("http://my-subdomain.localhost") -> empty
domain("http://my-subdomain.localhost") -> my-subdomain.localhost
The text was updated successfully, but these errors were encountered: