Want-Digest Header

Table of Content

  • Syntax
  • Directives
  • Examples
  • 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.

Syntax

The syntax for the Want-Digest header is as follows:

Want-Digest: <digest-algorithm>=<qvalue>

The <digest-algorithm> represents the desired digest-algorithm, and <qvalue> signifies the qvalue and is used to define the preference of the algorithm.

Directives

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.

Examples

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 qvalue of 0.8, but would also accept MD5 with a qvalue of 0.2.

Browser Compatibility

Browser Compatibility
Chrome Not Supported
Firefox Not Supported
Safari Not Supported
Opera Not Supported
Edge Not Supported

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:

  1. Install ModHeader extension from the Chrome Web Store
  2. Click on the ModHeader icon and select 'Add request header'
  3. In the 1st field, replace 'Header name' with 'Want-Digest'
  4. 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.