Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix port/host arguments for rack handler #2

Merged
merged 1 commit into from

2 participants

@zanker

The standard for rack handlers is to pass host and port as :Host and :Port, as you can see in https://github.com/rack/rack/blob/master/lib/rack/handler/thin.rb (and all the other handlers).

Currently you can't use things like Sinatra with this because Sinatra follows the standard, so it will never bind to a port.

@jballanc jballanc merged commit 1fb1fbe into from
@jballanc
Owner

Thanks for the update!

@zanker zanker deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 19, 2012
  1. @zanker
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 0 deletions.
  1. +3 −0  lib/rack/handler/control_tower.rb
View
3  lib/rack/handler/control_tower.rb
@@ -7,6 +7,9 @@ module Rack
module Handler
class ControlTower
def self.run(app, options={})
+ options[:port] = options.delete(:Port) if options[:Port]
+ options[:host] = options.delete(:Host) if options[:Host]
+
app = Rack::Chunked.new(Rack::ContentLength.new(app))
server = ::ControlTower::Server.new(app, options)
yield server if block_given?
Something went wrong with that request. Please try again.