Skip to content
This repository
tag: 1.0.0
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 17 lines (15 sloc) 0.534 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
require 'test/spec'
require 'rack/mock'
require 'rack/contrib/lighttpd_script_name_fix'

context "Rack::LighttpdScriptNameFix" do
  specify "corrects SCRIPT_NAME and PATH_INFO set by lighttpd " do
    env = {
      "PATH_INFO" => "/foo/bar/baz",
      "SCRIPT_NAME" => "/hello"
    }
    app = lambda { |_| [200, {'Content-Type' => 'text/plain'}, ["Hello, World!"]] }
    response = Rack::LighttpdScriptNameFix.new(app).call(env)
    env['SCRIPT_NAME'].should.be.empty
    env['PATH_INFO'].should.equal '/hello/foo/bar/baz'
  end
end
Something went wrong with that request. Please try again.