Skip to content

explainer.html's hardcoded <meta http-equiv="refresh"> ignores ?slug= and fires before the slug-aware redirect script, breaking the shim for every slug but the default #325

Description

@yakew7

Where: explainer.html:9-13:

<meta http-equiv="refresh" content="0; url=explainers/proxy-variables.html">
<script>
  (function () {
    var params = new URLSearchParams(window.location.search);
    var slug = params.get('slug') || 'proxy-variables';
    window.location.replace('explainers/' + encodeURIComponent(slug) + '.html' + window.location.hash);
  })();
</script>

.github/DEAD-FILE-AUDIT.md" (lines ~14-17) documents this file's entire purpose as a "?slug=-based redirect shim (explainer.html?slug=X->explainers/X.html`)" — presumably kept around for old bookmarks/links.

The bug: the <meta http-equiv="refresh">" tag is hardcoded to proxy-variables.html" and can't read the query string. Since it precedes the <script>" in document order and a 0-second meta-refresh fires essentially immediately once parsed (independent of, and typically before, script execution), a link like explainer.html?slug=some-other-explainer" almost always gets redirected to `proxy-variables.html" instead of the intended slug — defeating the file's documented purpose for every slug except the default one.

Suggested fix: remove the hardcoded <meta http-equiv="refresh">" tag entirely (the <script> already handles the redirect correctly, including the no-slug-param fallback to proxy-variables`) — it's redundant with the script for the default case and actively wrong for every other case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions