Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use FakeWeb::Utility.request_uri_as_string rather than our own logic …

…to create the request uri.
  • Loading branch information...
commit 7f582821a81fa5bcd2751bfb4d3d6828480c9d41 1 parent ed4a662
@myronmarston authored
Showing with 2 additions and 14 deletions.
  1. +1 −0  CHANGELOG.md
  2. +1 −14 lib/vcr/http_stubbing_adapters/fakeweb.rb
View
1  CHANGELOG.md
@@ -4,6 +4,7 @@
* Updated to use and require FakeWeb 1.3.0. It includes a fix for a bug related to multiple values for the
same response header.
+* Use new `FakeWeb::Utility.request_uri_as_string` method rather than our own logic to construct a request uri.
* Optimized `VCR.http_stubbing_adapter.stub_requests` a bit.
## 1.1.0 (August 22, 2010)
View
15 lib/vcr/http_stubbing_adapters/fakeweb.rb
@@ -52,20 +52,7 @@ def request_stubbed?(request, match_attributes)
end
def request_uri(net_http, request)
- # Copied from: http://github.com/chrisk/fakeweb/blob/fakeweb-1.2.8/lib/fake_web/ext/net_http.rb#L39-52
- protocol = net_http.use_ssl? ? "https" : "http"
-
- path = request.path
- path = URI.parse(request.path).request_uri if request.path =~ /^http/
-
- if request["authorization"] =~ /^Basic /
- userinfo = ::FakeWeb::Utility.decode_userinfo_from_header(request["authorization"])
- userinfo = ::FakeWeb::Utility.encode_unsafe_chars_in_userinfo(userinfo) + "@"
- else
- userinfo = ""
- end
-
- "#{protocol}://#{userinfo}#{net_http.address}:#{net_http.port}#{path}"
+ ::FakeWeb::Utility.request_uri_as_string(net_http, request)
end
attr_writer :ignore_localhost
Please sign in to comment.
Something went wrong with that request. Please try again.