jakeburden / next-absolute-url

Get the absolute URL of your Next.js app (optionally set a localhost dev URL)
300 stars 30 forks source link

Returns https instead of http if host is 127.0.0.1 #17

Closed ttoni closed 1 year ago

ttoni commented 4 years ago

The absoluteUrl function returns only http as protocol if host is 'localhost'. In case of '127.0.0.1' it always returns https. In some cases we have to use 127.0.0.1 instead of localhost, but that mixes up protocols returned by absoluteUrl.

bas080 commented 2 years ago

I see this as a bug as it makes little sense to have localhost be http and an equivalent to be https.

aceaspades-worldspark commented 1 year ago

@jakeburden @FDiskas

It looks like this fix was made in index.ts but doesn't seem to have transpiled properly into index.js. Sounds silly, but I'm currently running into this exact issue. I checked the code, and it looks like the old version remains in index.js