On Sun, Sep 08, 2013 at 06:15:06PM +0000, brian m. carlson wrote:

> The HTTP 1.1 standard requires an Allow header for 405 Method Not Allowed:
> 
>   The response MUST include an Allow header containing a list of valid methods
>   for the requested resource.
> 
> So provide such a header when we return a 405 to the user agent.

Makes sense.

>                       if (strcmp(method, c->method)) {
>                               const char *proto = getenv("SERVER_PROTOCOL");
> -                             if (proto && !strcmp(proto, "HTTP/1.1"))
> +                             if (proto && !strcmp(proto, "HTTP/1.1")) {
>                                       http_status(405, "Method Not Allowed");
> +                                     hdr_str("Allow", !strcmp("GET", 
> c->method) ?
> +                                             "GET, HEAD" : c->method);
> +                             }

It took me a minute to figure out what is going on here. But we seem to
convert HEAD requests into GETs elsewhere, so any "GET" service should
be able to do either.

Looks OK to me.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to