Handle path generation error for #switch
What does this MR do and why?
Contributes to #386836 (closed)
Problem
A specially crafted path value can lead to UrlGeneration error.
Solution
Handle UrlGeneration error and return 400 error instead.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
- Visit http://127.0.0.1:3000/gitlab-org/gitlab-shell/-/refs/switch?ref=main&ref_type=heads&path=*&destination=graphs
- You should see a Bad Request error instead of Internal Server.
Edited by Vasilii Iakliushin