-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(UVE): Page tools not working with traditional rendering (#29602)
### Proposed Changes * **Fix Placeholder Replacement**: Updated the `getRunnableLink` function to ensure placeholders `{requestHostName}`, `{currentUrl}`, and `{urlSearchParams}` are replaced correctly in the URL. * **Handle Null and Empty Values**: Improved handling of `null` and empty values for `currentUrl` and `requestHostName` to avoid unintended `null` values in the final URL. * **Query Parameters Formatting**: Corrected the formatting and appending of query parameters (`host_id` and `language_id`) to ensure they are correctly included in the URL when provided. * **Update Deprecated URL**: Updated the URL for Mozilla Observatory, which has been deprecated. ### Additional Info This PR addresses those issues by fixing how search parameters are formatted and applied, ensuring that page tools can properly recognize and utilize the `host_id` parameter. ### Differences **Wave URL Before:** https://wave.webaim.org/report#/http://localhost:4200/page-for-my-site?host_id=50a79decd9e21702cb2f52fc4935a52b?language_id=1 **Wave URL After:** https://wave.webaim.org/report#/http://localhost:4200/page-for-my-site?host_id=50a79decd9e21702cb2f52fc4935a52b&language_id=1 **Difference:** <img width="837" alt="image" src="https://github.com/user-attachments/assets/2809fb96-646c-4de7-a6c2-587322072480"> The query parameters in the "Before" URL used a `?` to separate `host_id` and `language_id`, whereas the "After" URL correctly uses `&`. --- **Security Headers Before:** https://securityheaders.com/?q=http://localhost:4200/page-for-my-site&host_id=50a79decd9e21702cb2f52fc4935a52b&language_id=1&followRedirects=on **Security Headers After:** https://securityheaders.com/?q=http://localhost:4200/page-for-my-site?host_id=50a79decd9e21702cb2f52fc4935a52b&language_id=1&followRedirects=on **Difference:** <img width="955" alt="image" src="https://github.com/user-attachments/assets/9bc06c96-6e91-4ee1-8be1-b23759ddbd1e"> In the "Before" URL, the `?` was incorrectly placed before the query parameters, while the "After" URL correctly places `?` only after the base URL, and `&` separates the query parameters. This PR fixes #29206
- Loading branch information
1 parent
6ae4f6a
commit 70974ab
Showing
3 changed files
with
211 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters