]> git.lizzy.rs Git - rust.git/blob - src/tools/error_index_generator/redirect.js
Generate error index with mdbook instead of raw HTML pages
[rust.git] / src / tools / error_index_generator / redirect.js
1 (function() {{
2     if (window.location.hash) {{
3         let code = window.location.hash.replace(/^#/, '');
4         // We have to make sure this pattern matches to avoid inadvertently creating an
5         // open redirect.
6         if (/^E[0-9]+$/.test(code)) {{
7             window.location = './error_codes/' + code + '.html';
8         }}
9     }}
10 }})()