Skip to content

Fix routing for /info/refs

Vasilii Iakliushin requested to merge 361962_fix_routing_for_info_refs into master

What does this MR do and why?

Contributes to #361962 (closed), #343150 (closed)

Problem

When the project has name info the URL to fetch refs :namespace/:project/refs is masked by the redirection logic for info/refs endpoint.

For example, path my-namespace/info/refs will trigger the redirect to my-namespace.git/info/refs which is incorrect.

Solution

Fix container path verification logic. Ensure that the path is a project path or a wiki path.

Screenshots or screen recordings

Before After
Screenshot_2022-05-25_at_19.35.04 Screenshot_2022-05-25_at_19.34.25

http://127.0.0.1:3000/root/info/refs

How to set up and validate locally

  1. Create project with the name info
  2. Visit URL: http://127.0.0.1:3000/root/info/refs
  3. You should see a list of refs instead of a redirect to http://127.0.0.1:3000/root.git/info/refs

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Vasilii Iakliushin

Merge request reports

Loading