question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] Decoding gzipped content for storage?

See original GitHub issue

This question is related to something I encountered when using before migrating to polly, but I see that the persisted recordings (.har files) store gzipped content text in encoded form.

I’d really like to have my recordings be human-readable (and editable), so I’d like to find a way to decode content as it’s persisted, then re-encode it when it’s read.

Is there a way to do this in polly?

Here’s an example I found of how to do something similar with nock (https://github.com/nock/nock/issues/1212), but I don’t really see any way to get at polly’s underlying nock implementation or any mechanism for extending the reading/writing of .har files.

UPDATE: it looks like my best bet may be to create a custom persister that wraps the FSPersister, manipulating the recorded data in findRecording and saveRecording… I’ll update this issue with my findings.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
jrnail23commented, Oct 11, 2019

Sure, will do.

0reactions
jasonmitcommented, Oct 11, 2019

@jrnail23 that seems like a bug in Polly. Can you open a separate issue for that?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Transcoding of gzip-compressed files | Cloud Storage
This page discusses the conversion of files to and from a gzip-compressed state. The page includes an overview of transcoding, best practices for...
Read more >
In Python, how do I decode GZIP encoding? - Stack Overflow
I use zlib to decompress gzipped content from web. import zlib import urllib f=urllib.request.urlopen(url) decompressed_data=zlib.decompress(f.read(), ...
Read more >
Content-Encoding - HTTP - MDN Web Docs
The Content-Encoding representation header lists any encodings that have been applied ... Content-Encoding: gzip Content-Encoding: compress ...
Read more >
Why Content-Encoding gzip rather than Transfer-Encoding gzip
The API responses are returned in gzipped format. But by using Content-Encoding gzip, the burden of unzipping is on the user of the...
Read more >
How To Improve Website Performance Using gzip and Nginx ...
For example, text files compress very well, often ending up over two times smaller. On the other hand, images such as JPEG or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found