Add util method for parsing URI strings

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

  • Close this issue

Summary

Create a method for parsing URIs in Gitlab::Utils.

def parse_uri(uri_string)
  Addressable::URI.parse(uri_string)
rescue Addressable::URI::InvalidURIError, TypeError
end

Improvements

This will remove the need for parse_uri methods in other parts of the code. It will also ensure that the correct exceptions are handled wherever URI strings need to be parsed.

Risks

Involved components

Optional: Intended side effects

Optional: Missing test coverage

Edited Sep 28, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading