webmock icon indicating copy to clipboard operation
webmock copied to clipboard

Typhoeus::Response#effective_url should be a string, Addressable::URI returned

Open erwanlr opened this issue 10 years ago • 2 comments

Related to #540

As mentioned in the Typhoeus' doc, the effective_url method should return a string: https://github.com/typhoeus/typhoeus/blob/de61860fecec32b58e150e63219d1a4062a77855/lib/typhoeus/response/informations.rb#L181

Currently in webmock, an Addressable::URI object is returned

The fix would be to replace https://github.com/bblimke/webmock/blob/bfc8206a8c728c5f93dca7ee13a83f4e7ebc79e3/lib/webmock/http_lib_adapters/typhoeus_hydra_adapter.rb#L101 by :effective_url => request_signature.uri.to_s

erwanlr avatar Dec 11 '15 10:12 erwanlr

Furthermore, the default port (either 80 or 443 depending on the http/s used) is returned, which screw up specs a bit :/

erwanlr avatar Dec 11 '15 17:12 erwanlr

Implemented a simple PR here to fix this: https://github.com/bblimke/webmock/pull/869

tbrammar avatar Jan 07 '20 10:01 tbrammar