Skip to content

Commit

Permalink
Handle absolute URIs (happens with Rails)
Browse files Browse the repository at this point in the history
  • Loading branch information
aslakhellesoy committed Dec 9, 2009
1 parent 76bda6e commit 61338d0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/capybara/server.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require 'uri'
require 'net/http'
require 'rack'
require 'rack/handler/mongrel'
Expand All @@ -18,6 +19,7 @@ def host
end

def url(path)
path = URI.parse(path).request_uri if path =~ /^http/
"http://#{host}:#{port}#{path}"
end

Expand Down

0 comments on commit 61338d0

Please sign in to comment.