Sorry, I didn't see this earlier.  -1 (veto).  This requirement will
be (or has already been) removed from httpbis because it hinders
extensibility and breaks content management systems, just as the
change below causes content-language to be broken.  That is why
we never implemented this requirement when it was added (without
consensus) to RFC 2616.

....Roy


On Feb 8, 2011, at 2:05 AM, rpl...@apache.org wrote:

> Author: rpluem
> Date: Tue Feb  8 10:05:07 2011
> New Revision: 1068310
> 
> URL: http://svn.apache.org/viewvc?rev=1068310&view=rev
> Log:
> Merge r1026746 from trunk:
> 
> If an unknown Content-* header is received for a PUT request, we must not
> ignore it but reply with 501 per RFC 2616 9.6.
> 
> PR: 42978
> 
> Submitted by: sf
> Reviewed by: rpluem, covener, poirier
> 
> Modified:
>    httpd/httpd/branches/2.2.x/   (props changed)
>    httpd/httpd/branches/2.2.x/CHANGES
>    httpd/httpd/branches/2.2.x/STATUS
>    httpd/httpd/branches/2.2.x/docs/   (props changed)
>    httpd/httpd/branches/2.2.x/docs/conf/mime.types   (props changed)
>    httpd/httpd/branches/2.2.x/docs/manual/mod/mod_autoindex.xml   (props 
> changed)
>    httpd/httpd/branches/2.2.x/modules/dav/main/mod_dav.c
>    httpd/httpd/branches/2.2.x/support/ab.c   (props changed)
>    httpd/httpd/branches/2.2.x/support/suexec.c   (props changed)
> 
> Propchange: httpd/httpd/branches/2.2.x/
> ------------------------------------------------------------------------------
> --- svn:mergeinfo (original)
> +++ svn:mergeinfo Tue Feb  8 10:05:07 2011
> @@ -1 +1 @@
> -/httpd/httpd/trunk:395552,417988,451572,583817,583830,611483,630858,639005,639010,647395,657354,657459,660461,660566,664330,678761,680082,681190,682369,683626,685112,686805,686809,687099,687754,693120,693392,693727-693728,696006,697093,706318,707163,708902,711421,719357,720250,729316-729317,729586,732414,732504,732832,733127,733134,733218-733219,734710,743589,755190,756671,756675,756678,756683,757741,761329,763394,764239,768535,769809,771587,771610,776325,777042,777091,778438-778439,778531,778942,780648,780655,780692,780697,780699,785457,785661,790587,803704,823536,823563,891282,932791,942209,953311,955966,992625,1026743,1031551
> +/httpd/httpd/trunk:395552,417988,451572,583817,583830,611483,630858,639005,639010,647395,657354,657459,660461,660566,664330,678761,680082,681190,682369,683626,685112,686805,686809,687099,687754,693120,693392,693727-693728,696006,697093,706318,707163,708902,711421,719357,720250,729316-729317,729586,732414,732504,732832,733127,733134,733218-733219,734710,743589,755190,756671,756675,756678,756683,757741,761329,763394,764239,768535,769809,771587,771610,776325,777042,777091,778438-778439,778531,778942,780648,780655,780692,780697,780699,785457,785661,790587,803704,823536,823563,891282,932791,942209,953311,955966,992625,1026743,1026746,1031551
> 
> Modified: httpd/httpd/branches/2.2.x/CHANGES
> URL: 
> http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/CHANGES?rev=1068310&r1=1068309&r2=1068310&view=diff
> ==============================================================================
> --- httpd/httpd/branches/2.2.x/CHANGES [utf-8] (original)
> +++ httpd/httpd/branches/2.2.x/CHANGES [utf-8] Tue Feb  8 10:05:07 2011
> @@ -1,6 +1,9 @@
>                                                          -*- coding: utf-8 -*-
> Changes with Apache 2.2.18
> 
> +  *) mod_dav: Send 501 error if unknown Content-* header is received for a 
> PUT
> +     request (RFC 2616 9.6). PR 42978. [Stefan Fritsch]
> +
>   *) mod_dav: Send 400 error if malformed Content-Range header is received for
>      a put request (RFC 2616 14.16). PR 49825. [Stefan Fritsch]
> 
> 
> Modified: httpd/httpd/branches/2.2.x/STATUS
> URL: 
> http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/STATUS?rev=1068310&r1=1068309&r2=1068310&view=diff
> ==============================================================================
> --- httpd/httpd/branches/2.2.x/STATUS (original)
> +++ httpd/httpd/branches/2.2.x/STATUS Tue Feb  8 10:05:07 2011
> @@ -98,15 +98,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
>      2.2.x patch: 
> http://people.apache.org/~minfrin/httpd-mod_cache-304-fix-2.patch
>      +1: minfrin, jim, covener
> 
> -  * mod_dav: If an unknown Content-* header is received for a PUT request, we
> -    must not ignore it but reply with 501 per RFC 2616 9.6.
> -    PR: 42978
> -    Trunk version of patch:
> -      http://svn.apache.org/viewvc?rev=1026746&view=rev
> -    Backport version for 2.2.x of patch:
> -      Trunk version of patch works
> -    +1: rpluem, covener, poirier
> -
> PATCHES PROPOSED TO BACKPORT FROM TRUNK:
>   [ New proposals should be added at the end of the list ]
> 
> 
> Propchange: httpd/httpd/branches/2.2.x/docs/
> ------------------------------------------------------------------------------
> --- svn:mergeinfo (original)
> +++ svn:mergeinfo Tue Feb  8 10:05:07 2011
> @@ -1 +1 @@
> -/httpd/httpd/trunk/docs:395552,417988,451572,583817,583830,611483,630858,639005,639010,647395,657354,657459,660461,660566,664330,675610,678761,680082,681190,682369,683626,684351,685112,686549,686805,686809,687099,687754,692325,693120,693392,693727-693728,696006,697093,703441,703997,706318,707163,708902,711421,719357,720250,726109,728015,728020,728220,729316-729317,729586,732414,732421,732451,732504,732832,733127,733134,733218-733219,733465,733467,733695,734703,734710,743589,755190,756671,756675,756678,756683,757741,761329,763394,764239,768535,769809,771587,771610,776325,777042,777091,778438-778439,778531,778942,780648,780655,780692,780697,780699,785457,785661,790587,803704,891282,942209,955966,992625,1026743
> +/httpd/httpd/trunk/docs:395552,417988,451572,583817,583830,611483,630858,639005,639010,647395,657354,657459,660461,660566,664330,675610,678761,680082,681190,682369,683626,684351,685112,686549,686805,686809,687099,687754,692325,693120,693392,693727-693728,696006,697093,703441,703997,706318,707163,708902,711421,719357,720250,726109,728015,728020,728220,729316-729317,729586,732414,732421,732451,732504,732832,733127,733134,733218-733219,733465,733467,733695,734703,734710,743589,755190,756671,756675,756678,756683,757741,761329,763394,764239,768535,769809,771587,771610,776325,777042,777091,778438-778439,778531,778942,780648,780655,780692,780697,780699,785457,785661,790587,803704,891282,942209,955966,992625,1026743,1026746
> 
> Propchange: httpd/httpd/branches/2.2.x/docs/conf/mime.types
> ------------------------------------------------------------------------------
> --- svn:mergeinfo (original)
> +++ svn:mergeinfo Tue Feb  8 10:05:07 2011
> @@ -1 +1 @@
> -/httpd/httpd/trunk/docs/conf/mime.types:83749-896271,942209,955966,992625,1026743
> +/httpd/httpd/trunk/docs/conf/mime.types:83749-896271,942209,955966,992625,1026743,1026746
> 
> Propchange: httpd/httpd/branches/2.2.x/docs/manual/mod/mod_autoindex.xml
> ------------------------------------------------------------------------------
> --- svn:mergeinfo (original)
> +++ svn:mergeinfo Tue Feb  8 10:05:07 2011
> @@ -1 +1 @@
> -/httpd/httpd/trunk/docs/manual/mod/mod_autoindex.xml:395552,417988,451572,583817,583830,611483,630858,639005,639010,647395,657354,657459,660461,660566,664330,675610,678761,680082,681190,682369,683626,684351,685112,686549,686805,686809,687099,687754,692325,693120,693392,693727-693728,696006,697093,703441,703997,706318,707163,708902,711421,719357,720250,726109,728015,728020,728220,729316-729317,729586,732414,732421,732451,732504,732832,733127,733134,733218-733219,733465,733467,733695,734703,734710,743589,755190,756671,756675,756678,756683,757741,761329,763394,764239,768535,769809,771587,771610,776325,777042,777091,778438-778439,778531,778942,780648,780655,780692,780697,780699,785457,785661,790587,803704,891282,942209,955966,992625,1026743,1059559-1059589
> +/httpd/httpd/trunk/docs/manual/mod/mod_autoindex.xml:395552,417988,451572,583817,583830,611483,630858,639005,639010,647395,657354,657459,660461,660566,664330,675610,678761,680082,681190,682369,683626,684351,685112,686549,686805,686809,687099,687754,692325,693120,693392,693727-693728,696006,697093,703441,703997,706318,707163,708902,711421,719357,720250,726109,728015,728020,728220,729316-729317,729586,732414,732421,732451,732504,732832,733127,733134,733218-733219,733465,733467,733695,734703,734710,743589,755190,756671,756675,756678,756683,757741,761329,763394,764239,768535,769809,771587,771610,776325,777042,777091,778438-778439,778531,778942,780648,780655,780692,780697,780699,785457,785661,790587,803704,891282,942209,955966,992625,1026743,1026746,1059559-1059589
> 
> Modified: httpd/httpd/branches/2.2.x/modules/dav/main/mod_dav.c
> URL: 
> http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/dav/main/mod_dav.c?rev=1068310&r1=1068309&r2=1068310&view=diff
> ==============================================================================
> --- httpd/httpd/branches/2.2.x/modules/dav/main/mod_dav.c (original)
> +++ httpd/httpd/branches/2.2.x/modules/dav/main/mod_dav.c Tue Feb  8 10:05:07 
> 2011
> @@ -812,6 +812,30 @@ static int dav_parse_range(request_rec *
>     return 1;
> }
> 
> +static const char *dav_validate_content_headers(request_rec *r)
> +{
> +    int i, prefix_len = strlen("content-");
> +    const apr_array_header_t *arr = apr_table_elts(r->headers_in);
> +    const apr_table_entry_t *elts = (const apr_table_entry_t *)arr->elts;
> +
> +    for (i = 0; i < arr->nelts; ++i) {
> +         if (elts[i].key == NULL)
> +             continue;
> +         if (strncasecmp(elts[i].key, "content-", prefix_len) == 0
> +             && strcasecmp(elts[i].key + prefix_len, "length") != 0
> +             && strcasecmp(elts[i].key + prefix_len, "range") != 0
> +             /* Content-Location may be ignored per RFC 2616 14.14 */
> +             && strcasecmp(elts[i].key + prefix_len, "location") != 0
> +             && strcasecmp(elts[i].key + prefix_len, "type") != 0)
> +         {
> +             /* XXX: content-md5? content-language? content-encoding? */
> +             return apr_psprintf(r->pool, "Support for %s is not 
> implemented.",
> +                                 ap_escape_html(r->pool, elts[i].key));
> +         }
> +    }
> +    return NULL;
> +}
> +
> /* handle the GET method */
> static int dav_method_get(request_rec *r)
> {
> @@ -959,6 +983,14 @@ static int dav_method_put(request_rec *r
>         mode = DAV_MODE_WRITE_TRUNC;
>     }
> 
> +    if ((body = dav_validate_content_headers(r)) != NULL) {
> +        /* RFC 2616 9.6: We must not ignore any Content-* headers we do not
> +         * understand.
> +         * XXX: Relax this for HTTP 1.0 requests?
> +         */
> +        return dav_error_response(r, HTTP_NOT_IMPLEMENTED, body);
> +    }
> +
>     /* make sure the resource can be modified (if versioning repository) */
>     if ((err = dav_auto_checkout(r, resource,
>                                  0 /* not parent_only */,
> 
> Propchange: httpd/httpd/branches/2.2.x/support/ab.c
> ------------------------------------------------------------------------------
> --- svn:mergeinfo (original)
> +++ svn:mergeinfo Tue Feb  8 10:05:07 2011
> @@ -1 +1 @@
> -/httpd/httpd/trunk/support/ab.c:83751-655654,657354,657433,657459,660461,660566,664330,678761,680082,681190,682369,683626,685112,686805,686809,687099,687754,693120,693392,693727-693728,696006,697093,706318,707163,708902,711421,719357,720250,729316-729317,729586,732414,732504,732832,733127,733134,733218-733219,734710,743589,755190,756671,756675,756678,756683,757741,761329,763394,764239,768535,769809,771587,771610,776325,777042,777091,778438-778439,778531,778942,780648,780655,780692,780697,780699,785457,785661,790587,803704,891282,942209,955966,992625,1026743
> +/httpd/httpd/trunk/support/ab.c:83751-655654,657354,657433,657459,660461,660566,664330,678761,680082,681190,682369,683626,685112,686805,686809,687099,687754,693120,693392,693727-693728,696006,697093,706318,707163,708902,711421,719357,720250,729316-729317,729586,732414,732504,732832,733127,733134,733218-733219,734710,743589,755190,756671,756675,756678,756683,757741,761329,763394,764239,768535,769809,771587,771610,776325,777042,777091,778438-778439,778531,778942,780648,780655,780692,780697,780699,785457,785661,790587,803704,891282,942209,955966,992625,1026743,1026746
> 
> Propchange: httpd/httpd/branches/2.2.x/support/suexec.c
> ------------------------------------------------------------------------------
> --- svn:mergeinfo (original)
> +++ svn:mergeinfo Tue Feb  8 10:05:07 2011
> @@ -1 +1 @@
> -/httpd/httpd/trunk/support/suexec.c:395552,417988,451572,583817,583830,611483,630858,639005,639010,647395,655711,657354,657459,660461,660566,664330,678761,680082,681190,682369,683626,685112,686805,686809,687099,687754,693120,693392,693727-693728,696006,697093,706318,707163,708902,711421,719357,720250,729316-729317,729586,732414,732504,732832,733127,733134,733218-733219,734710,743589,755190,756671,756675,756678,756683,757741,761329,763394,764239,768535,769809,771587,771610,776325,777042,777091,778438-778439,778531,778942,780648,780655,780692,780697,780699,785457,785661,790587,803704,891282,942209,955966,992625,1026743
> +/httpd/httpd/trunk/support/suexec.c:395552,417988,451572,583817,583830,611483,630858,639005,639010,647395,655711,657354,657459,660461,660566,664330,678761,680082,681190,682369,683626,685112,686805,686809,687099,687754,693120,693392,693727-693728,696006,697093,706318,707163,708902,711421,719357,720250,729316-729317,729586,732414,732504,732832,733127,733134,733218-733219,734710,743589,755190,756671,756675,756678,756683,757741,761329,763394,764239,768535,769809,771587,771610,776325,777042,777091,778438-778439,778531,778942,780648,780655,780692,780697,780699,785457,785661,790587,803704,891282,942209,955966,992625,1026743,1026746
> 
> 

Reply via email to