Permalink
Browse files

Merge commit 'cschneid/master' into pu

  • Loading branch information...
2 parents c705cfd + b404b0a commit 4ea9c9ff0b60a8c7721c2a98d778b52a0e9b1faf @rtomayko rtomayko committed Jun 22, 2008
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/sinatra.rb
View
@@ -122,8 +122,14 @@ def env
def server
options.server ||= defined?(Rack::Handler::Thin) ? "thin" : "mongrel"
+
# Convert the server into the actual handler name
- handler = options.server.capitalize.sub(/cgi$/, 'CGI')
+ handler = options.server.capitalize
+
+ # If the convenience conversion didn't get us anything,
+ # fall back to what the user actually set.
+ handler = options.server unless Rack::Handler.const_defined?(handler)
+
@server ||= eval("Rack::Handler::#{handler}")
end

0 comments on commit 4ea9c9f

Please sign in to comment.