Export to GitHub

phantomjs - issue #930

PhantomJS does not like GZIP compression in some scenarios


Posted on Dec 20, 2012 by Massive Bear

Which version of PhantomJS are you using? 1.7.0 for Windows stock from the web-page.

What steps will reproduce the problem? Run PhantomJS against a web server with a slightly malformed GZIP response stream (attached a sample VS 2010 project hooking into IIS Express 8.0 that demonstrates this problem) and watch PhantomJS fall over itself every now and then. I think this is because of two distinct WebKit related bugs:

1) https://bugs.webkit.org/show_bug.cgi?id=58727 2) https://bugreports.qt-project.org/browse/QTBUG-16022

But both of them seem to be fixed, so not sure if they are truly related.

I've attached a Visual Studio project which demonstrates the problem. I've configured it such that the server (IIS Express must be installed as well) sends back GZIPped content if the "X-Test-Runner" request header is not present and send back GZIPped content if the "X-Test-Runner" request header is present. When the content is GZIPed, then PhantomJS will sometimes throw an "$ is undefined" exception but sometimes work correctly. When the content is not GZIPed, then PhantomJS will work correctly.

Sorry if this bug report isn't exactly the clearest, I've had a hell of a time tracking down the problem and if you need any further details please do let me know.

Attachments

Comment #1

Posted on Dec 20, 2012 by Quick Monkey

Ouch. PhantomJS 1.8 crashes!

Comment #2

Posted on Dec 20, 2012 by Quick Monkey

Crash dump attached. OS: Win 7 x64. IIS Express 7.5. Command line: testrunner.js http://localhost:62097/index.html true

Attachments

Comment #3

Posted on Feb 16, 2013 by Grumpy Camel

i know this is not a support forum... but a workaround would be to add headers on the request saying we can't handle gzip. is this easy to do?

Comment #4

Posted on Feb 16, 2013 by Massive Bear

FWIW, that is the workaround that we are using right now. You can just configure Phantom with a bogus custom Accept-Encoding header using the customHeaders object: ttps://github.com/ariya/phantomjs/wiki/API-Reference-WebPage#wiki-webpage-customHeaders (and sorry for the support forum-esque answer :)

Comment #5

Posted on Mar 16, 2013 by Happy Horse

Closing. This issue has been moved to GitHub: https://github.com/ariya/phantomjs/issues/10930

Status: Migrated

Labels:
Type-Defect Priority-Medium