-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PORT in URL address in production (Astro.url) #12192
Comments
Hi @Fakerko, can I ask you to try |
Hi @ematipico, I tried, but was not able to test it because the production environment ended on error see screenshot. |
Hey @Fakerko, what version of Node.js are you using? |
If you do: > new Request('http://example.com:80/url').url
'http://example.com/url' The port gets stripped when you call |
@matthewp Hi, I am using v20.17.0 on the production server. The problem is that I didn't edit anything on the site, I only updated from Astro version 4.15.7 to 4.16.0 and the URLs were wrong. |
@matthewp Just tested, that the last working version is Astro v4.15.12. After update to v4.16.0 or v4.16.2 the problem appear. |
@matthewp I disabled cache on the site https://www.palocko.cz/test do you see the port is changing every time on page reload? I think this is not normal. |
@Fakerko we just released a patch ( |
@ematipico It fixed the issue! Working as expected now. Thank you. |
@Fakerko what port number were you seeing? |
@matthewp Now I don't see any port anymore. Before I always saw a random 5 digit port. |
Astro Info
If this issue only occurs in one browser, which browser is a problem?
Tested in Chrome
Describe the Bug
When I call Astro.url, Astro.url.href, Astro.url.host and Astro.url.origin return the URL in the format:
http(s)://www.example.com:PORT
Which is correct in a development environment, but not in production.
In a previous version of Astro, I tested Astro v4.15.7, the URL did not include PORT in production.
Reproduced code example in production: https://www.palocko.cz/test
I think it's related to: #12130
What's the expected result?
In production it should not contain the PORT after domain.
So instead of http(s)://www.example.com:PORT it should be http(s)://www.example.com
As mentioned here: https://docs.astro.build/en/reference/api-reference/#astrourl
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-7rspdv?file=src%2Fpages%2Findex.astro
Participation
The text was updated successfully, but these errors were encountered: