From: reyk Date: Wed, 27 Jul 2016 11:02:41 +0000 (+0000) Subject: According to RFC 7231 4.3.7, OPTIONS may have body. "Although this X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=986dfe8a680866880d2664bab1dff2b7052b5f0b;p=openbsd According to RFC 7231 4.3.7, OPTIONS may have body. "Although this specification does not define any use for such a payload, future extensions to HTTP might use the OPTIONS body to make more detailed queries about the target resource." The future has arrived. Found and tested by Michael Lechtermann OK benno@ --- diff --git a/usr.sbin/httpd/server_http.c b/usr.sbin/httpd/server_http.c index 98144f8f480..b69805a3d5d 100644 --- a/usr.sbin/httpd/server_http.c +++ b/usr.sbin/httpd/server_http.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server_http.c,v 1.108 2016/05/27 11:24:13 krw Exp $ */ +/* $OpenBSD: server_http.c,v 1.109 2016/07/27 11:02:41 reyk Exp $ */ /* * Copyright (c) 2006 - 2015 Reyk Floeter @@ -380,12 +380,12 @@ server_read_http(struct bufferevent *bev, void *arg) case HTTP_METHOD_DELETE: case HTTP_METHOD_GET: case HTTP_METHOD_HEAD: - case HTTP_METHOD_OPTIONS: /* WebDAV methods */ case HTTP_METHOD_COPY: case HTTP_METHOD_MOVE: clt->clt_toread = 0; break; + case HTTP_METHOD_OPTIONS: case HTTP_METHOD_POST: case HTTP_METHOD_PUT: case HTTP_METHOD_RESPONSE: diff --git a/usr.sbin/relayd/relay_http.c b/usr.sbin/relayd/relay_http.c index bab21355b2d..c933f992f35 100644 --- a/usr.sbin/relayd/relay_http.c +++ b/usr.sbin/relayd/relay_http.c @@ -1,4 +1,4 @@ -/* $OpenBSD: relay_http.c,v 1.57 2016/07/27 06:55:44 reyk Exp $ */ +/* $OpenBSD: relay_http.c,v 1.58 2016/07/27 11:02:41 reyk Exp $ */ /* * Copyright (c) 2006 - 2015 Reyk Floeter @@ -401,9 +401,9 @@ relay_read_http(struct bufferevent *bev, void *arg) case HTTP_METHOD_DELETE: case HTTP_METHOD_GET: case HTTP_METHOD_HEAD: - case HTTP_METHOD_OPTIONS: cre->toread = 0; break; + case HTTP_METHOD_OPTIONS: case HTTP_METHOD_PATCH: case HTTP_METHOD_POST: case HTTP_METHOD_PUT: