Faraday Version: 2.6.0 (though issue is present in latest afaik)
Ruby Version: 3.1.2
Issue description
The URL isn't available on the response object after being converted to a hash. When using certain middleware (e.g https://github.com/tisba/faraday-follow-redirects) the URL on the response isn't necessarily the same as on the request. This information can be therefore valuable to have to check the final URL used to fetch the response.
Assuming there are no unintended consequences of adding the url to the to_hash object, this should be an easy modification to make. (I am happy to follow up with a PR after discussion here).
Basic Info
Issue description
The URL isn't available on the response object after being converted to a hash. When using certain middleware (e.g https://github.com/tisba/faraday-follow-redirects) the URL on the response isn't necessarily the same as on the request. This information can be therefore valuable to have to check the final URL used to fetch the response.
Steps to reproduce
Remediation
Assuming there are no unintended consequences of adding the url to the
to_hash
object, this should be an easy modification to make. (I am happy to follow up with a PR after discussion here).https://github.com/lostisland/faraday/blob/0e16de8e5ad3d29810c3388ea95836e0e4689635/lib/faraday/response.rb#L61-L66