Page MenuHomePhabricator

Workaround for Safari '.gz' extension bug
Closed, ResolvedPublic

Description

The latest updates to Safari in Mac OS X 10.4.4 seem to have broken loading of
pages that have a ".gz" extension when they're sent with gzip encoding.

The browser downloads the gzipped text to a file instead of displaying it
inline. This is clearly a bug in either Safari itself or WebKit; I'll
investigate and file bugs/patches to Apple.

In the meantime, we might consider as a workaround sending pages whose URLs
end in '.gz' without compression. Yucky hack, but seems to work in my testing.

(Possibly refile this under Wikimedia, if we don't want such a hack polluting
the main software. An if() in CommonSettings will do the job.)


Version: unspecified
Severity: minor
OS: Mac OS X 10.4
Platform: Macintosh
URL: http://en.wikipedia.org/wiki/Image:California_map_showing_counties_%28source%29.xcf.gz

Details

Reference
bz4635

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:03 PM
bzimport set Reference to bz4635.
bzimport added a subscriber: Unknown Object (MLST).

Added hack in CommonSettings.php like this:

  1. Safari bug with URLs ending in ".gz" and gzip encoding
  2. http://bugzilla.wikimedia.org/show_bug.cgi?id=4635

$hatesSafari = isset( $_SERVER['PATH_INFO'] ) &&

strtolower( substr( $_SERVER['PATH_INFO'], -3 ) ) == '.gz';

then check that var before adding the buffering handler.

Marking this FIXED since I've worked around it, still investigating to
make sure it's reported back to Apple.

Haven't found the source of the problem in WebKit source yet, but can
confirm that I can't correctly visit pages which would exhibit this
bug in Safari in a quickie WebKit-based Xcode project. So it doesn't
seem to be the Safari front-end code, but lower-level where I might
be able to locate it...

Alas, it seems to be even lower-level than WebKit/WebCore, so out of my reach
again. :)

As recommended by the folks in #webkit, I've filed a bug with Apple.
Radar problem ID 4410917.

Do we still need this hack in our settings? Is 6 years enough time to hope everyone is running a newer version? I guess in the Apple world that's even more likely...

http://stats.wikimedia.org/wikimedia/squids/SquidReportClients.htm

It's probably safe to ditch this, but test first. :)