Update CONTENT_INTEGRITY.md

merge-requests/9/merge
Michał "rysiek" Woźniak 2021-12-17 03:35:13 +00:00
rodzic 1187984181
commit cae39e6de8
1 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -20,7 +20,9 @@ However, whether or not integrity is *actually* verified depends on the plugin u
For example, integrity (when set for a given request) *will* be verified when using `fetch` and `alt-fetch` plugins, simply because under the hood these plugins use the regular [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API), as implemented by the browser. The Fetch API [`fetch()` method](https://developer.mozilla.org/en-US/docs/Web/API/fetch) accepts an `integrity` init param, and is expected to use it to verify integrity.
A plugin that does not rely on the Fetch API will not benefit from this automatic integrity checking by the browser. In such cases, the `integrity-check` plugin can be used to wrap a such a transport plugin. The `integrity-check` plugin wraps a transport plugin, and when that transport plugin returns a successful `Response`, checks the integrity of the body of that response based on integrity data set on the `Request`. If the integrity check fails, an error is returned.
A plugin that does not rely on the Fetch API will not benefit from this automatic integrity checking by the browser. In such cases, the `integrity-check` plugin can be used to wrap a such a transport plugin. The `integrity-check` plugin wraps a transport plugin, and when that transport plugin returns a successful `Response`, checks the integrity of the body of that response based on [integrity data set in the `Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request/integrity).
If the integrity check fails, an error is returned.
## General Content Interity