Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
After upgrade from 6.x-1.9 to 6.x-2.0 or 6.x-2.1, many pages that should be redirected to https are instead displaying a white screen with the words "302 found" at the top of the page. The url shown in the browser is the correct URL for the target page.
If I comment out line 162 of securepages.module:
print "302 Found";
and clear the cache, then the redirect appears to complete successfully (at least on the pages I've checked).
Comment | File | Size | Author |
---|---|---|---|
#4 | Screen_Shot_2013-11-19_at_1.14.39_PM.png | 245.83 KB | grendzy |
Comments
Comment #1
gordon CreditAttribution: gordon commentedI think this is something different in how the bufferering is use to be done. I have removed the line which should help things.
Comment #2
grendzy CreditAttribution: grendzy commentedI believe outputting "302 Found" is correct. A non-empty body is necessary for Drupal to cache the response. rclemings, are you using Boost? Other boost users have reported this: #1415292: Securepages prints "302 Found" which is cached by Boost as is..
According to rfc2616, the entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s).
Gordon, if we can determine this issue is caused be the Boost bug, what do you think about reverting the last change? Boost is fundamentally incompatible with securepages anyway, because it cannot differentiate between HTTP and HTTPS pages (see #1070048: New folder structure).
Comment #3
rclemings CreditAttribution: rclemings commentedNo, not using Boost. And in any case there is no hyperlink, just the words "302 Found" in plain text, so that users are left staring at those two words with no redirect and no idea of what they should do next.
Comment #4
grendzy CreditAttribution: grendzy commentedComment #5
grendzy CreditAttribution: grendzy commentedHmmm, that is really strange. When you see the "302 found" message in your browser, what is the HTTP status code? (you can determine this from the network inspector in Chrome). I'm not able to reproduce that with 6.x-2.0. If you have an opportunity to test with a fresh D6 install, can you report the outcome here?
I agree the code could be improved by adding an actual link as the RFC says (the original message was just added as filler to make drupal_page_set_cache() happy).
Comment #6
grendzy CreditAttribution: grendzy commentedOne note, the reason this wasn't caught by the tests is the redirect test assertion was commented out, due to caching headers being absent from D6 (unlike Drupal 7). I found a different way to test the cache behavior, so this test has been fixed: 1ad73a9 on 6.x-2.x