class Rack::LighttpdScriptNameFix
Lighttpd sets the wrong SCRIPT_NAME and PATH_INFO if you mount your FastCGI app at “/”. This middleware fixes this issue.
Public Class Methods
new(app)
click to toggle source
# File lib/rack/contrib/lighttpd_script_name_fix.rb, line 6 def initialize(app) @app = app end
Public Instance Methods
call(env)
click to toggle source
# File lib/rack/contrib/lighttpd_script_name_fix.rb, line 10 def call(env) env["PATH_INFO"] = env["SCRIPT_NAME"].to_s + env["PATH_INFO"].to_s env["SCRIPT_NAME"] = "" @app.call(env) end