elastic / elastic/docs

Malformed document page when URL query contains slash

Open
#2,214 8 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Ruby
Stars
265
Forks
347
Avg merge
3d 15h
Merged PRs (30d)
2

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:
https://github.com/elastic/docs/blob/5b6ac7928c141d9eebeb13d078501a5e77d64d13/resources/web/docs_js/index.js#L253-L260

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.