MCPcopy Create free account
hub / github.com/apache/httpd / dav_add_vary_header

Function dav_add_vary_header

modules/dav/main/util.c:1874–1901  ·  view source on GitHub ↗

dav_add_vary_header * * If there were any headers in the request which require a Vary header * in the response, add it. */

Source from the content-addressed store, hash-verified

1872 * in the response, add it.
1873 */
1874DAV_DECLARE(void) dav_add_vary_header(request_rec *in_req,
1875 request_rec *out_req,
1876 const dav_resource *resource)
1877{
1878 const dav_hooks_vsn *vsn_hooks = DAV_GET_HOOKS_VSN(in_req);
1879
1880 /* ### this is probably all wrong... I think there is a function in
1881 ### the Apache API to add things to the Vary header. need to check */
1882
1883 /* Only versioning headers require a Vary response header,
1884 * so only do this check if there is a versioning provider */
1885 if (vsn_hooks != NULL) {
1886 const char *target = apr_table_get(in_req->headers_in, DAV_LABEL_HDR);
1887
1888 /* If Target-Selector specified, add it to the Vary header */
1889 if (target != NULL) {
1890 const char *vary = apr_table_get(out_req->headers_out, "Vary");
1891
1892 if (vary == NULL)
1893 vary = DAV_LABEL_HDR;
1894 else
1895 vary = apr_pstrcat(out_req->pool, vary, "," DAV_LABEL_HDR,
1896 NULL);
1897
1898 apr_table_setn(out_req->headers_out, "Vary", vary);
1899 }
1900 }
1901}
1902
1903/* dav_can_auto_checkout
1904 *

Callers 1

dav_get_resourceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected