-
Notifications
You must be signed in to change notification settings - Fork 347
Description
I came across a few links from Google search and found out that precedence of slash (/
) in the URL query string will lead to malformed / unresponsive document page.
Example of malformed page: https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html?example.com/a
I believe the root cause is in the TOC fetching script:
docs/resources/web/docs_js/index.js
Lines 253 to 260 in 5b6ac79
var url = location.href.replace(/[^\/]+$/, 'toc.html'); | |
var toc = $.get(url, {}, function(data) { | |
right_col.append(data); | |
init_toc(LangStrings); | |
utils.open_current(location.pathname); | |
}).always(function() { | |
init_headers(right_col, LangStrings); | |
}); |
In this case location.href
is https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html?example.com/a
, and after replacing the string it will fetch and append https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html?example.com/toc.html
which causes infinite loop and unresponsive page.