Skip to content

Instantly share code, notes, and snippets.

@damon
Created November 18, 2008 01:12
Show Gist options
  • Save damon/26011 to your computer and use it in GitHub Desktop.
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
require 'blog'
require 'thin'
require 'rack_fix'
run Rack::Adapter::Camping.new(Blog)
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