summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/gitlab/route_map.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/gitlab/route_map.rb b/lib/gitlab/route_map.rb
index f96c30b3e33..72d00abfcc2 100644
--- a/lib/gitlab/route_map.rb
+++ b/lib/gitlab/route_map.rb
@@ -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