monolith/docs/arch/0004-asset-integrity-check.md

22 lines
764 B
Markdown
Raw Normal View History

2020-02-24 05:15:32 +01:00
# 4. Asset integrity check
Date: 2020-02-23
## Status
2020-05-25 03:10:35 +02:00
Accepted
2020-02-24 05:15:32 +01:00
## Context
2020-05-25 03:21:52 +02:00
In HTML5, `link` and `script` nodes have an attribute named `integrity`, which lets the browser check if the remote file is valid, mostly for the purpose of enhancing page security.
2020-02-24 05:15:32 +01:00
## Decision
2020-05-25 03:21:52 +02:00
In order to replicate the browser's behavior, the program should perform integrity check the same way it does, excluding the linked asset from the final result if such check fails.
2020-02-24 05:15:32 +01:00
2020-05-25 03:21:52 +02:00
The `integrity` attribute should be removed from nodes, as it bears no benefit for resources embedded as data URLs.
2020-02-24 05:15:32 +01:00
## Consequences
2020-05-25 03:21:52 +02:00
Assets that fail to pass the check get excluded from the saved document. Meanwhile, saved documents no longer contain integrity attributes on all `link` and `script` nodes.