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
 8 def initialize(app)
 9   @app = app
10 end

Public Instance Methods

call(env) click to toggle source
   # File lib/rack/contrib/lighttpd_script_name_fix.rb
12 def call(env)
13   env["PATH_INFO"] = env["SCRIPT_NAME"].to_s + env["PATH_INFO"].to_s
14   env["SCRIPT_NAME"] = ""
15   @app.call(env)
16 end