Created
November 18, 2008 01:12
-
-
Save damon/26011 to your computer and use it in GitHub Desktop.
a fix for Camping/Rack found here - http://jira.codehaus.org/browse/JRUBY-2859
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'blog' | |
require 'thin' | |
require 'rack_fix' | |
run Rack::Adapter::Camping.new(Blog) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Rack | |
module Adapter | |
class Camping | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
env["PATH_INFO"] ||= "" | |
env["SCRIPT_NAME"] ||= "" | |
controller = @app.run(env['rack.input'], env) | |
h = controller.headers | |
h.each_pair do |k,v| | |
if v.kind_of? URI | |
h[k] = v.to_s | |
end | |
end | |
[controller.status, controller.headers, [controller.body.to_s]] | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment