summary refs log tree commit
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2019-07-16 02:52:41 +0100
committerGitHub <noreply@github.com>2019-07-16 02:52:41 +0100
commit36679765cd0026d6dbd16d34a179eb3b3cc2565d (patch)
treefd951d15b25eff8f3788842078a3cb7abf19dc4d
parent44392451472a98b29a6b565cb218a5fe03ac0055 (diff)
parent05dc95a78c46390fed519f1ee0bf9482f865c4e6 (diff)
downloadrack-36679765cd0026d6dbd16d34a179eb3b3cc2565d.tar.gz
Merge pull request #1376 from esparta/no_regex_rack_builder
Do not use regex on Rack::Builder.parse_file
-rw-r--r--lib/rack/builder.rb5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/rack/builder.rb b/lib/rack/builder.rb
index f343fffc..dcd40c76 100644
--- a/lib/rack/builder.rb
+++ b/lib/rack/builder.rb
@@ -1,7 +1,5 @@
 # frozen_string_literal: true
 
-require_relative 'core_ext/regexp'
-
 module Rack
   # Rack::Builder implements a small DSL to iteratively construct Rack
   # applications.
@@ -33,13 +31,12 @@ module Rack
   # You can use +map+ to construct a Rack::URLMap in a convenient way.
 
   class Builder
-    using ::Rack::RegexpExtensions
 
     # https://stackoverflow.com/questions/2223882/whats-the-difference-between-utf-8-and-utf-8-without-bom
     UTF_8_BOM = '\xef\xbb\xbf'
 
     def self.parse_file(config, opts = Server::Options.new)
-      if /\.ru$/.match?(config)
+      if config.end_with?('.ru')
         return self.load_file(config, opts)
       else
         require config