
bugzilla at apache
May 8, 2012, 8:47 PM
Post #2 of 5
(110 views)
Permalink
|
|
[Bug 50823] Provide alternate failure modes for http on https
[In reply to]
|
|
https://issues.apache.org/bugzilla/show_bug.cgi?id=50823 --- Comment #14 from Nathan Schulte <nmschulte [at] gmail> --- (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 "https". 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 constraints. -- You are receiving this mail because: You are the assignee for the bug.
|