1

I've used LWP capability to handle gzip encoded content as described here, but in some cases I randomly get unexpected results at least for the one website I've tested: $response->decoded_content could become undefined while $response->content still returns original gzip encoded response. Tried even without internal charset decoding (decoded_content(charset => 'none')) with the same result.

Community
  • 1
  • 1
Dopamine
  • 185
  • 1
  • 11

2 Answers2

3

Is the server perhaps not properly setting Content-Encoding in the response? In any case, take a look at the headers for both working and non-working responses and look for significant differences.

ysth
  • 96,171
  • 6
  • 121
  • 214
3

This doesn't directly answer your question, but when I encounter things like this I look at the source of the module to see what it is doing and debug the code just like any other code. Looking at the decoded_content method in HTTP::Message shows you exactly what it is expecting. Check that your response has all of the things it expects.

brian d foy
  • 129,424
  • 31
  • 207
  • 592