1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Treat path-like hosts as unix sockets. Fixes #824

This commit is contained in:
Evan Phoenix 2016-02-25 13:42:29 -08:00
parent 61294479b2
commit 90e6e3e011

View file

@ -28,10 +28,16 @@ module Rack
c.threads min, max
end
host = options[:Host] || ::Puma::Configuration::DefaultTCPHost
port = options[:Port] || ::Puma::Configuration::DefaultTCPPort
host = options[:Host]
c.port port, host
if host && (host[0,1] == '.' || host[0,1] == '/')
c.bind "unix://#{host}"
else
host ||= ::Puma::Configuration::DefaultTCPHost
port = options[:Port] || ::Puma::Configuration::DefaultTCPPort
c.port port, host
end
c.app app
end