diff options
author | Espartaco Palma <esparta@gmail.com> | 2019-07-15 02:26:32 -0700 |
---|---|---|
committer | Espartaco Palma <esparta@gmail.com> | 2019-07-15 02:26:32 -0700 |
commit | 05dc95a78c46390fed519f1ee0bf9482f865c4e6 (patch) | |
tree | fd951d15b25eff8f3788842078a3cb7abf19dc4d | |
parent | 44392451472a98b29a6b565cb218a5fe03ac0055 (diff) | |
download | rack-05dc95a78c46390fed519f1ee0bf9482f865c4e6.tar.gz |
Do not use regex on Rack::Builder.parse_file
-rw-r--r-- | lib/rack/builder.rb | 5 |
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 |