Skip to content

Handle path generation error for #switch

Vasilii Iakliushin requested to merge 386836_fix_path_generation_error into master

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
Screenshot_2024-01-08_at_11.38.41 Screenshot_2024-01-08_at_11.36.52

How to set up and validate locally

  1. Visit http://127.0.0.1:3000/gitlab-org/gitlab-shell/-/refs/switch?ref=main&ref_type=heads&path=*&destination=graphs
  2. You should see a Bad Request error instead of Internal Server.
Edited by Vasilii Iakliushin

Merge request reports