You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Enable cache in the localmakebash-develrailsdev:cachebin/railscurl="https://avatars.githubusercontent.com/u/12815721?s=200&v=4"# set cacher_2=Rails.cache.fetch("sean_test",expires_in: 5.minutes,race_condition_ttl: 5,force: true)dor=HTTParty.get(url)end# test if body available (it will be)r_2.request.raw_body# fetch cacher_2_cache=Rails.cache.fetch("sean_test",expires_in: 5.minutes,race_condition_ttl: 5)doHTTParty.get(url)end;nil# test if body available (it won't be)r_2_cache.request.raw_body
The text was updated successfully, but these errors were encountered:
I think the best thing is to serialize all the ivars and then re-initialize them but this should at least solve this issue and not cause backwards compat issues (hopefully).
@seanneale That said, I would not recommend digging into internals like you are. One of the things you are accessing is just an ivar which if not given a method should really be treated as private. I'll think on that PR and see if anything else should go in. Should be able to merge soonish.
Rails 6.0.5.1
Ruby 2.7.6
We have recently upgraded HTTParty to v0.20.0 and found that the cached response is missing some information from the
response.request
:We require raw_request for our logging, so have reverted to v0.19.1
Scripts to reproduce the issue:
The text was updated successfully, but these errors were encountered: