ctrlplusb / react-universally

A starter kit for universal react applications.
MIT License
1.7k stars 244 forks source link

put meta[charset] before title #497

Closed ambar closed 6 years ago

ctrlplusb commented 6 years ago

Thanks for this @ambar - is this considered best practice? Do you have any reference material for interests sake?

ambar commented 6 years ago

@ctrlplusb https://github.com/sonarwhal/sonar/blob/master/docs/user-guide/rules/meta-charset-utf-8.md

Must be inside the <head> element and within the first 1024 bytes of the HTML, as some browsers only look at those bytes before choosing an encoding.

Moreover, it is recommended that the meta tag be the first thing in the . This ensures it is before any content that could be controlled by an attacker, such as a element, thus, avoiding potential encoding-related security issues (such as the one in old IE).</p> </blockquote> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/ctrlplusb"><img src="https://avatars.githubusercontent.com/u/12164768?v=4" />ctrlplusb</a> commented <strong> 6 years ago</strong> </div> <div class="markdown-body"> <p>TIL 😄 </p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/ctrlplusb"><img src="https://avatars.githubusercontent.com/u/12164768?v=4" />ctrlplusb</a> commented <strong> 6 years ago</strong> </div> <div class="markdown-body"> <p>Thanks again @ambar! Really appreciate the contribution ❤️</p> </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>