Class: Gearup::Server::GzRewrite
- Inherits:
-
Object
- Object
- Gearup::Server::GzRewrite
- Defined in:
- lib/gearup/server.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ GzRewrite
constructor
A new instance of GzRewrite.
Constructor Details
#initialize(app) ⇒ GzRewrite
Returns a new instance of GzRewrite.
27 28 29 |
# File 'lib/gearup/server.rb', line 27 def initialize app @app = app end |
Instance Method Details
#call(env) ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/gearup/server.rb', line 31 def call env if env["PATH_INFO"] =~ /\.gz$/ env["PATH_INFO"] = env["PATH_INFO"].sub(/\.gz$/, "") env["REQUEST_PATH"] = env["REQUEST_PATH"].sub(/\.gz$/, "") env["REQUEST_URI"] = env["REQUEST_URI"].sub(/\.gz$/, "") end @app.call(env) end |