Local subdomains not included in middleware URL hostname
Answered
African Slender-snouted Crocodil… posted this in #help-forum
African Slender-snouted CrocodileOP
I'm using Paraglide JS with Next to have typesafe translations. Paraglide has different locale detections strategies (as a middleware), one being subdomain detection. The implementation of it uses the
To fix this, I added into my hosts file (on windows):
hoping the hostname would be correct and the middleware would have the subdomain, however it still shows as the request as
Is this an issue with Paraglide JS and should it be using the
hostname property of the request url of which doesn't include the subdomain on localhost.To fix this, I added into my hosts file (on windows):
127.0.0.1 form.test
127.0.0.1 ru.form.testhoping the hostname would be correct and the middleware would have the subdomain, however it still shows as the request as
localhost even when visiting form.test or ru.form.test (and again, missing the subdomain). Long story short, the only way to get the middleware to have the subdomain is to run next dev -H ru.form.test but the issue with that is what if there is more than 1 locale subdomain. I can't add more than 1 host to the command.Is this an issue with Paraglide JS and should it be using the
host property instead? Or is it possible to have the middleware correctly detect the subdomain on localhost?Answered by African Slender-snouted Crocodile
removing the host argument now makes it work. im honestly not sure whats changed since then cause I didn't have the host argument for most of the time but oh well
1 Reply
African Slender-snouted CrocodileOP
removing the host argument now makes it work. im honestly not sure whats changed since then cause I didn't have the host argument for most of the time but oh well
Answer