Skip to content

Commit

Permalink
Merge 2a28792 into 0ec7153
Browse files Browse the repository at this point in the history
  • Loading branch information
tarcieri committed Apr 24, 2016
2 parents 0ec7153 + 2a28792 commit 21fc1e4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/rails/auth/acl/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def match(env)
#
def match!(env)
return false unless @http_methods.nil? || @http_methods.include?(env["REQUEST_METHOD".freeze])
return false unless @path =~ env["REQUEST_PATH".freeze]
return false unless @path =~ env["PATH_INFO".freeze]
return false unless @host.nil? || @host =~ env["HTTP_HOST".freeze]
true
end
Expand Down
2 changes: 1 addition & 1 deletion lib/rails/auth/error_page/debug_page.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
</tr>
<tr>
<td class="label">Path</td>
<td><%= h(env["REQUEST_PATH"]) %></td>
<td><%= h(env["PATH_INFO"]) %></td>
</tr>
<tr>
<td class="label">Host</td>
Expand Down
2 changes: 1 addition & 1 deletion lib/rails/auth/rspec/helper_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def x509_certificate_hash(**args)

env = {
"REQUEST_METHOD" => method,
"REQUEST_PATH" => self.class.description
"PATH_INFO" => self.class.description
}

certificates.each do |type, value|
Expand Down
5 changes: 3 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ def fixture_path(*args)
Pathname.new(File.expand_path("../fixtures", __FILE__)).join(*args)
end

def env_for(method, path)
def env_for(method, path, host = "127.0.0.1")
{
"REQUEST_METHOD" => method.to_s.upcase,
"REQUEST_PATH" => path
"PATH_INFO" => path,
"HTTP_HOST" => host
}
end

0 comments on commit 21fc1e4

Please sign in to comment.