Make CDN Downloads Safer
Resources like JavaScript libraries and fonts/Hono can be obtained from Content Delivery Networks (CDNs). This is a convenient way to get started quickly when building a new web application. But there are good reasons to avoid using CDNs when your apps go into production.
Using CDNs makes your app dependent on their availability and speed. Typically, neither of these is an issue. But copying the files from CDNs to your own server eliminates these potential issues.
Getting resources from a CDN also introduces a security risk. A hacker could replace files served by the CDN with malicious ones. This can be detected by using SubResource Integrity (SRI) hashes.
Using SRI hashes is easy. You need to determine the hash of each ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access