Repository navigation
fix(rest): match brand site URLs with or without a trailing slash, and read validated REST params - #387
fix(rest): match brand site URLs with or without a trailing slash, and read validated REST params#387justlevine wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #387 +/- ##
============================================
- Coverage 90.82% 90.78% -0.04%
+ Complexity 889 887 -2
============================================
Files 51 51
Lines 3336 3333 -3
Branches 181 182 +1
============================================
- Hits 3030 3026 -4
Misses 255 255
- Partials 51 52 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Kallyan01
left a comment
There was a problem hiding this comment.
@justlevine, the URL input doesn't trim leading or trailing spaces when pasted, which breaks the connection. Also, anyone can modify the URL without needing to provide any key.
Screen.Recording.2026-11-17.at.13.52.22.mov
Thanks @Kallyan01 , fixed in 2e8713d . Looks like that issue also affects onedesign, so I'm backporting to there too. |
What
/shared-sitesand/algolia-credentialscallbacks now read the params the route already validated, so a save works the same whether it's sent as JSON or as a form.Why
The duplicate check compared raw URLs, so
https://brand.comandhttps://brand.com/could both get saved, with one hiding the other. The site modal did the same, so removing the slash while editing asked for a new API key and failed to save without one.The callbacks ignored the validated params and read the raw JSON body. A form-encoded save to
/shared-sitespassed validation, decoded to nothing, and wiped every brand site with a 200. A form-encoded save to/algolia-credentialsfailed with "Both App ID and Write Key are required."Related Issue(s):
How
Utils::normalize_url()in the controller andSettings(instead of a mix of that andtrailingslashit()), andSiteModalcompares them withwithTrailingSlash()like OneDesign does.$request['sites_data'],$request['app_id']and$request['write_key'].AI Disclosure
Opus 5.5 identified the mismatched and backported the initial version and draft PR description.
Testing Instructions
Screenshots
Additional Info
Checklist