set_compression_dictionary_hash


Description:

[ Version ( since = "3.8" ) ]
public void set_compression_dictionary_hash (Bytes? hash)

Sets the SHA-256 hash of the shared dictionary to advertise for Compression Dictionary Transport (RFC 9842).

When set, [class@ContentDecoder] will include `dcb` and/or `dcz` in the `Accept-Encoding` request header (over HTTPS) and will send an `Available-Dictionary` header containing the base64-encoded hash. When the server responds with `Content-Encoding: dcb` or `dcz`, the [signal@Message:SoupMessage:request-compression-dictionary] signal is emitted so the caller can supply the actual dictionary bytes.

If the dictionary was registered with an identifier, set it with [method@Message.set_compression_dictionary_id] so that a `Dictionary-ID` header accompanies `Available-Dictionary`.

The hash does not survive redirects: a dictionary is chosen for a specific request URL, so when this is redirected the hash, the id and both headers are cleared. It is the caller's responsibility to select and set a new dictionary appropriate for the redirect target, if any.

Parameters:

this

a Message

hash

a Bytes containing the raw SHA-256 hash (32 bytes) of the shared dictionary, or null to unset