Skip to content

Remove sanitizeUrl function

Eduardo Sanz García requested to merge eduardosanz/remove-sanitize-url into master

What does this MR do and why?

Relates to Improvements in app/assets/javascripts/lib/util... (#467984)

Remove sanitizeUrl function

The sanitation that sanitizeUrl offers is minimal. It returns about:blank for invalid URLs. sanitizeUrl is used only once.

Internally, sanitizeUrl uses isValidURL (and new URL(...)) to decide if a URL is valid. In the only place that sanitizeUrl is used, I haven't found a way to make the URL /${this.projectPath}/-/error_tracking/${errorId}.json invalid. Even if we found a way, the user will be puzzled to navigate to a about:blank page.

I suggest we remove the sanitizeUrl function.

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

No changes

How to set up and validate locally

N/A

Edited by Eduardo Sanz García

Merge request reports