patch_vary_headers
Add (or update) the "Vary" header in the given HttpResponse object. newheaders is a list of header names that should be in "Vary". If headers contains an asterisk, then "Vary" header will consist of a single asterisk '*'. Otherwise, existing headers in "Vary" aren't removed.
def patch_vary_headers(
response: HttpResponse,
newheaders: list
) - > null
Add (or update) the "Vary" header in the given HttpResponse object. newheaders is a list of header names that should be in "Vary". If headers contains an asterisk, then "Vary" header will consist of a single asterisk '*'. Otherwise, existing headers in "Vary" aren't removed.
Parameters
| Name | Type | Description |
|---|---|---|
| response | HttpResponse | The HTTP response object whose headers will be modified. |
| newheaders | list | A list of header names to be added to the Vary header, ensuring they are not duplicated while preserving original order. |
Returns
| Type | Description |
|---|---|
null | The function modifies the response object in-place and does not return a value. |