Use stricter regex anchors

This commit is contained in:
Douwe Maan 2017-02-07 14:26:00 -06:00
parent 636e9bdd11
commit 2666ef9f04
1 changed files with 1 additions and 1 deletions

View File

@ -35,7 +35,7 @@ module Gitlab
source_pattern = source_pattern[1...-1].gsub('\/', '/')
begin
source_pattern = Regexp.new("^#{source_pattern}$")
source_pattern = /\A#{source_pattern}\z/
rescue RegexpError => e
raise FormatError, "Route map entry source is not a valid regular expression: #{e}"
end