Skip to content

Proxy asset URLs with protocol but no slashes

Dominic Couture requested to merge dcouture-camo-http-slashless into master

What does this MR do and why?

URLs with a protocol but no slashes (http:example.com) aren't proxied but somehow the browser works well with those so they should have been proxied. This MR fixes that.

A second commit refactors the tests to remove the copy pasting.

Fixes https://gitlab.com/gitlab-org/gitlab/-/issues/381748

Screenshots or screen recordings

No visual changes

How to set up and validate locally

  1. Configure the asset proxy https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/doc/howto/asset_proxy.md
  2. Post <img src=http:www.iana.org/_img/2022/iana-logo-header.svg> in an issue (or MR, or comment, or...)
  3. Inspect the element and ensure the image source is going through the asset proxy

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 Dominic Couture

Merge request reports