Skip to content

Enforce new Markdown upload URL format

Heinrich Lee Yu requested to merge hly-enforce-markdown-upload-urls into master

What does this MR do and why?

In 17.1, we started generating ID-based URLs for Markdown uploads. But we maintained support for the old URL format to keep backward compatibility with existing upload URLs.

This MR enforces the use of the new URL format for uploads created starting 17.2.

Related to https://gitlab.com/gitlab-sirt/shared-incidents/incident_5281/-/issues/14 (limited access)

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.

How to set up and validate locally

  1. Upload a file to an issue comment or description and save.
  2. Check the generated HTML and you should see that the URL generated is in the format: http://localhost:3000/-/project/<project-id>/uploads/<secret>/<filename>
  3. Manually visit: http://localhost:3000/<project-full-path>/uploads/<secret>/<filename>. This should 404.
  4. You can also try an upload that was created before switching to this branch and the legacy URL should work.
Edited by Heinrich Lee Yu

Merge request reports