docs: clarify Astro.url and Astro.params runtime behavior#13903
docs: clarify Astro.url and Astro.params runtime behavior#13903Prayaksh wants to merge 1 commit into
Conversation
✅ Deploy Preview for astro-docs-2 ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Hello! Thank you for opening your first PR to Astro’s Docs! 🎉 Here’s what will happen next:
|
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
There was a problem hiding this comment.
Thanks for your contribution!
If this is indeed a documentation issue (I wouldn't say "probably" means "confirmation"), this addition can be helpful but it doesn't fully fix the issue.
The issue mentions a misleading description in https://docs.astro.build/en/reference/api-reference/#url and potentially in https://docs.astro.build/en/reference/api-reference/#params
@ematipico can you confirm we should fix the docs? Or the fix mentioned by the bot could work and no docs change is required?
Edit: I hadn't followed the linked PR, it seems this might have been fixed in withastro/astro#16808 ?
|
I realize now that I acted on the “probably” comment before the issue was fully confirmed. Thank you for clarifying. I’m still learning the process and will make sure to verify before updating the docs in the future. |
|
The documentation update is still valid, because not all characters can be safely decoded e.g. |
|
Okay, thanks Ema! And no problem @Prayaksh! Are you still willing to check if other pages require an update? It seems we at least need to update https://docs.astro.build/en/reference/api-reference/#url |
Description (required)
This PR clarifies the runtime behavior of URL decoding in Astro v6 dynamic routes.
The original issue was reported in the
withastro/astrorepository, and after maintainer confirmation it was identified as a documentation gap rather than a runtime bug.In Astro v6,
Astro.urlreturns a normalized and partially decoded URL, which may differ fromnew URL(Astro.request.url). Additionally,Astro.paramsvalues are automatically decoded. This behavior was not clearly documented in the v6 upgrade guide section covering percent-encoded routes.This update adds a runtime clarification under the “Percent-Encoding in routes” section to reflect the actual behavior and avoid confusion for users working with encoded dynamic route segments.
Related issues & labels (optional)
documentation