fixing bug with rails use of rack-test
This commit is contained in:
parent
a4dd0b3433
commit
de9b3385fc
@ -26,7 +26,7 @@
|
||||
s.add_dependency('builder', '~> 2.1.2')
|
||||
s.add_dependency('i18n', '~> 0.4.1')
|
||||
s.add_dependency('rack', '~> 1.2.1')
|
||||
s.add_dependency('rack-test', '~> 0.5.4')
|
||||
s.add_dependency('rack-test', '~> 0.5.5')
|
||||
s.add_dependency('rack-mount', '~> 0.6.13')
|
||||
s.add_dependency('tzinfo', '~> 0.3.23')
|
||||
s.add_dependency('erubis', '~> 2.6.6')
|
||||
|
@ -257,17 +257,19 @@ def process(method, path, parameters = nil, rack_environment = nil)
|
||||
end
|
||||
end
|
||||
|
||||
port = host.split(':')[1]
|
||||
|
||||
env = {
|
||||
:method => method,
|
||||
:params => parameters,
|
||||
|
||||
"SERVER_NAME" => host.split(':')[0],
|
||||
"SERVER_PORT" => (https? ? "443" : "80"),
|
||||
"SERVER_PORT" => (port ? port : (https? ? "443" : "80")),
|
||||
"HTTPS" => https? ? "on" : "off",
|
||||
"rack.url_scheme" => https? ? "https" : "http",
|
||||
|
||||
"REQUEST_URI" => path,
|
||||
"HTTP_HOST" => host,
|
||||
"HTTP_HOST" => [host, port].compact.join(':'),
|
||||
"REMOTE_ADDR" => remote_addr,
|
||||
"CONTENT_TYPE" => "application/x-www-form-urlencoded",
|
||||
"HTTP_ACCEPT" => accept
|
||||
|
Loading…
Reference in New Issue
Block a user