httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Bug 50823] Provide alternate failure modes for http on https
Date Wed, 09 May 2012 03:47:19 GMT

--- Comment #14 from Nathan Schulte <> ---
(In reply to comment #12)
> But if someone provides the javascript that adds the https link, I would be
> happy to add that.

Here is a (i.e. one of many possibly suitable version) JavaScript function that
will append the removed link, block quote and all.

function fix() {
    var p = document.getElementsByTagName('p')[0];
    var href = window.location.toString().replace(/^.*:\/\//i, 'https://');
    var bq = document.createElement('bq');
    bq.innerHTML = '<a href="' + href + '"><b>' + href + '</b></a>';
    p.parentNode.insertBefore(bq, p.nextSibling);

Just in case, it functions as follows:
1) Find the first paragraph (p) element in the document.  This should be the
one added  by the block of code modified to remove the link, but as I'm
unfamiliar with Apache, I don't know if it's possible for some user
configuration or other code to add another prior.
2) Case-insensitively Replace the protocol, even if it's not "http", with
3) Create the blockquote element and stuff the link as it's contents, finally
adding the blockquote element and it's children to the document immediately
after the paragraph element.

To test, I added it inside a script element (<script
language="JavaScript"></script>) in the HTML head element of the saved error
page, and added 'onload="fix();"' to the body element.  This requires
modification of the head and body elements which may or may not be an option. 
I'll whip up another if my assumptions aren't suitable, just let me know my

You are receiving this mail because:
You are the assignee for the bug.

View raw message