{"action":"created","issue":{"url":"https://api.github.com/repos/kevin1024/vcrpy/issues/259","repository_url":"https://api.github.com/repos/kevin1024/vcrpy","labels_url":"https://api.github.com/repos/kevin1024/vcrpy/issues/259/labels{/name}","comments_url":"https://api.github.com/repos/kevin1024/vcrpy/issues/259/comments","events_url":"https://api.github.com/repos/kevin1024/vcrpy/issues/259/events","html_url":"https://github.com/kevin1024/vcrpy/pull/259","id":161359901,"number":259,"title":"Fix deepcopy issue for response headers when `decode_compressed_response` is enabled","user":{"login":"nickdirienzo","id":723567,"avatar_url":"https://avatars.githubusercontent.com/u/723567?v=3","gravatar_id":"","url":"https://api.github.com/users/nickdirienzo","html_url":"https://github.com/nickdirienzo","followers_url":"https://api.github.com/users/nickdirienzo/followers","following_url":"https://api.github.com/users/nickdirienzo/following{/other_user}","gists_url":"https://api.github.com/users/nickdirienzo/gists{/gist_id}","starred_url":"https://api.github.com/users/nickdirienzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickdirienzo/subscriptions","organizations_url":"https://api.github.com/users/nickdirienzo/orgs","repos_url":"https://api.github.com/users/nickdirienzo/repos","events_url":"https://api.github.com/users/nickdirienzo/events{/privacy}","received_events_url":"https://api.github.com/users/nickdirienzo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-06-21T06:38:30Z","updated_at":"2016-06-21T14:16:21Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/kevin1024/vcrpy/pulls/259","html_url":"https://github.com/kevin1024/vcrpy/pull/259","diff_url":"https://github.com/kevin1024/vcrpy/pull/259.diff","patch_url":"https://github.com/kevin1024/vcrpy/pull/259.patch"},"body":"Hi @kevin1024 and @IvanMalison,\r\n\r\nI ran into this issue after the 1.8.0 release where the first time I would request gzipped data inside a cassette context, my test would fail with a JSON deserialization issue.\r\n\r\nI narrowed down the problem to be the data being returned by the stub would not have content encoding set as gzip but the content was not decoded (as the original response should not be modified), so `requests` was failing when I would call `.json()`.\r\n\r\nIn the filter to decode gzipped data, `headers` is a reference to the original response headers`gzip` is in a list and therefore being shallow copied in the `__init__` of `util.CaseInsensitiveDict`.\r\n\r\nLooking forward to your feedback. Cheers!\r\n\r\n(Aside: after going through some of the cassette code, I think a better place for the `self._before_record_request` and `self._before_record_response` calls would be in `_save` so `append` doesn't have side-effects. If you think so too happy to send this over in a separate PR.)"},"comment":{"url":"https://api.github.com/repos/kevin1024/vcrpy/issues/comments/227453446","html_url":"https://github.com/kevin1024/vcrpy/pull/259#issuecomment-227453446","issue_url":"https://api.github.com/repos/kevin1024/vcrpy/issues/259","id":227453446,"user":{"login":"nickdirienzo","id":723567,"avatar_url":"https://avatars.githubusercontent.com/u/723567?v=3","gravatar_id":"","url":"https://api.github.com/users/nickdirienzo","html_url":"https://github.com/nickdirienzo","followers_url":"https://api.github.com/users/nickdirienzo/followers","following_url":"https://api.github.com/users/nickdirienzo/following{/other_user}","gists_url":"https://api.github.com/users/nickdirienzo/gists{/gist_id}","starred_url":"https://api.github.com/users/nickdirienzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickdirienzo/subscriptions","organizations_url":"https://api.github.com/users/nickdirienzo/orgs","repos_url":"https://api.github.com/users/nickdirienzo/repos","events_url":"https://api.github.com/users/nickdirienzo/events{/privacy}","received_events_url":"https://api.github.com/users/nickdirienzo/received_events","type":"User","site_admin":false},"created_at":"2016-06-21T14:16:20Z","updated_at":"2016-06-21T14:16:20Z","body":"Updated the test to not depend on `requests`. I misunderstood when VCR comes into play. Hope this still looks good."}}
{"actor":{"display_login":"nickdirienzo"}}