Table of Content
- Browser Compatibility
- How to modify Want-Digest header The Want-Digest header is used to indicate that the server should provide a Digest response header in the response. This can be used to validate the content of a resource, for data integrity checks, and to prevent data corruption. The server can choose to ignore this header if it cannot fulfill it, meaning it's not a requirement but simply a preference for integrity checks.
The syntax for the Want-Digest header is as follows:
<digest-algorithm> represents the desired digest-algorithm, and
<qvalue> signifies the qvalue and is used to define the preference of the algorithm.
The directives for the Want-Digest header include the Digest Algorithm and Qvalue. The Digest Algorithm includes algorithms such as sha-256, md5, and sha-512. The
qvalue directive assigns a weight to the algorithm and can range from 0.0 to 1.0.
Below is an example of how one might use the Want-Digest header:
Want-Digest: SHA-256;q=0.8, MD5;q=0.2
Here, the user prefers SHA-256 with a
0.8, but would also accept MD5 with a
Currently, the Want-Digest header is not supported by any major browsers.
How to modify Want-Digest header
ModHeader is a browser extension that allows you to modify HTTP headers. With this extension, you can add, modify, and remove request headers and response headers. It can be useful to test the integrity check by adding the Want-Digest header field.
To add the Want-Digest header, follow these steps:
- Install ModHeader extension from the Chrome Web Store
- Click on the ModHeader icon and select 'Add request header'
- In the 1st field, replace 'Header name' with 'Want-Digest'
- In the 2nd field, replace 'Header value' with the your preferred algorithm and its qvalue, for instance, 'SHA-256;q=0.8'
This effectively instructs the server to use the SHA-256 algorithm with a qvalue of 0.8 to validate data integrity although it is up to server whether it will follow this instruction or not.