httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Ehrhardt <php...@ehrhardt.nl>
Subject mod_http2 1.0.7+ and Drupal (Was: No H2 Window updates!)
Date Sun, 06 Dec 2015 03:44:23 GMT
Some words for sysadmins: this is a rather annoying bug because there is
not any sign in the logs that the client has a content decoding failure.
You can never be sure that the user gets to see what the server sends to
the client.

Jan Ehrhardt in gmane.comp.apache.devel (Sun, 06 Dec 2015 01:34:47 +0100):
>I will try to intercept the compressed content and see if I can make a
>static page out of it, outside of Drupal and without having to log in as
>Drupal admin.

If content decoding is successful, Chrome stores the compressed content in
the cache. I saved such a file as admin_menu_encoded.txt.gz and made it
available as https://tfrtst.sessionportal.net/admin_menu_encoded.php

PHP-script:

<?php
// open the file in a binary mode
$name = './admin_menu_encoded.txt.gz';
$fp = fopen($name, 'rb');
// send the right headers
header("Content-Type: text/html; charset=utf-8");
// admin_menu_encoded.txt.gz is already gzip'ed, so make sure
// zlib.output_compression does not compress it once more.
ini_set('zlib.output_compression', '0');
header('Content-Encoding: gzip');
header("Cache-Control: no-cache, must-revalidate, post-check=0,
pre-check=0");
header("Content-Length: " . filesize($name));
// dump the file and stop the script
fpassthru($fp);
exit;
?>

The bummer: this file does not fail, whichever mod_http2 I load. Firefox
also fails with mod_http2 1.0.7+ and gives some extra information in the
headers:

X-Requested-With: XMLHttpRequest

The explanation: the drupal admin menu is loaded by JQuery, using an
Ajax-call. The return value of that call is (1) decoded (gunzipped) and
(2) loaded in a <div id="admin-menu"> almost at the end of the page.

Yet that Ajax call is not the culprit either. If I enter the URL of the
admin-menu directly Chrome reports a ERR_CONTENT_DECODING_FAILED and
Firefox:

>Content Encoding Error
>
>The page you are trying to view cannot be shown because
>it uses an invalid or unsupported form of compression.
>
>Please contact the website owners to inform them of this problem.

You will not see this message when the admin menu is loaded by JQuery.

So far the analysis at this moment. I do not know what I could investigate
now. Suggestions welcome.
-- 
Jan


Mime
View raw message