Browse Source

[core] recognize more http methods to forward to backends (fixes #2346)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2883 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.33
Stefan Bühler 9 years ago
parent
commit
3df2ec9248
  1. 1
      NEWS
  2. 43
      src/keyvalue.c
  3. 71
      src/keyvalue.h

1
NEWS

@ -20,6 +20,7 @@ NEWS
* [auto* build] simplify autogen.sh, handle automake 1.13 test running (fixes #2490)
* [mod_userdir] add userdir.active option, "enabled" by default
* [core] return 501 Not Implemented in static file mode for all methods except GET/POST/HEAD/OPTIONS
* [core] recognize more http methods to forward to backends (fixes #2346)
- 1.4.32 - 2012-11-21
* Code cleanup with clang/sparse (fixes #2437, thx kibi)

43
src/keyvalue.c

@ -13,29 +13,44 @@ static keyvalue http_versions[] = {
};
static keyvalue http_methods[] = {
{ HTTP_METHOD_GET, "GET" },
{ HTTP_METHOD_POST, "POST" },
{ HTTP_METHOD_GET, "GET" },
{ HTTP_METHOD_HEAD, "HEAD" },
{ HTTP_METHOD_PROPFIND, "PROPFIND" },
{ HTTP_METHOD_PROPPATCH, "PROPPATCH" },
{ HTTP_METHOD_REPORT, "REPORT" },
{ HTTP_METHOD_OPTIONS, "OPTIONS" },
{ HTTP_METHOD_MKCOL, "MKCOL" },
{ HTTP_METHOD_POST, "POST" },
{ HTTP_METHOD_PUT, "PUT" },
{ HTTP_METHOD_PATCH, "PATCH" },
{ HTTP_METHOD_DELETE, "DELETE" },
{ HTTP_METHOD_CONNECT, "CONNECT" },
{ HTTP_METHOD_OPTIONS, "OPTIONS" },
{ HTTP_METHOD_TRACE, "TRACE" },
{ HTTP_METHOD_ACL, "ACL" },
{ HTTP_METHOD_BASELINE_CONTROL, "BASELINE-CONTROL" },
{ HTTP_METHOD_BIND, "BIND" },
{ HTTP_METHOD_CHECKIN, "CHECKIN" },
{ HTTP_METHOD_CHECKOUT, "CHECKOUT" },
{ HTTP_METHOD_COPY, "COPY" },
{ HTTP_METHOD_MOVE, "MOVE" },
{ HTTP_METHOD_LABEL, "LABEL" },
{ HTTP_METHOD_CHECKOUT, "CHECKOUT" },
{ HTTP_METHOD_CHECKIN, "CHECKIN" },
{ HTTP_METHOD_MERGE, "MERGE" },
{ HTTP_METHOD_LINK, "LINK" },
{ HTTP_METHOD_LOCK, "LOCK" },
{ HTTP_METHOD_UNLOCK, "UNLOCK" },
{ HTTP_METHOD_MERGE, "MERGE" },
{ HTTP_METHOD_MKACTIVITY, "MKACTIVITY" },
{ HTTP_METHOD_MKCALENDAR, "MKCALENDAR" },
{ HTTP_METHOD_MKCOL, "MKCOL" },
{ HTTP_METHOD_MKREDIRECTREF, "MKREDIRECTREF" },
{ HTTP_METHOD_MKWORKSPACE, "MKWORKSPACE" },
{ HTTP_METHOD_MOVE, "MOVE" },
{ HTTP_METHOD_ORDERPATCH, "ORDERPATCH" },
{ HTTP_METHOD_PATCH, "PATCH" },
{ HTTP_METHOD_PROPFIND, "PROPFIND" },
{ HTTP_METHOD_PROPPATCH, "PROPPATCH" },
{ HTTP_METHOD_REBIND, "REBIND" },
{ HTTP_METHOD_REPORT, "REPORT" },
{ HTTP_METHOD_SEARCH, "SEARCH" },
{ HTTP_METHOD_UNBIND, "UNBIND" },
{ HTTP_METHOD_UNCHECKOUT, "UNCHECKOUT" },
{ HTTP_METHOD_UNLINK, "UNLINK" },
{ HTTP_METHOD_UNLOCK, "UNLOCK" },
{ HTTP_METHOD_UPDATE, "UPDATE" },
{ HTTP_METHOD_UPDATEREDIRECTREF, "UPDATEREDIRECTREF" },
{ HTTP_METHOD_VERSION_CONTROL, "VERSION-CONTROL" },
{ HTTP_METHOD_CONNECT, "CONNECT" },
{ HTTP_METHOD_UNSET, NULL }
};

71
src/keyvalue.h

@ -11,31 +11,56 @@
struct server;
/* sources:
* - [RFC2616], Section 9
* (or http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-22)
* - http://tools.ietf.org/html/draft-ietf-httpbis-method-registrations-11, Appendix A
*
* http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-22, Section 8.1 defines
* a new registry (not available yet):
* http://www.iana.org/assignments/http-methods
*/
typedef enum {
HTTP_METHOD_UNSET = -1,
HTTP_METHOD_GET,
HTTP_METHOD_POST,
HTTP_METHOD_HEAD,
HTTP_METHOD_OPTIONS,
HTTP_METHOD_PROPFIND, /* WebDAV */
HTTP_METHOD_MKCOL,
HTTP_METHOD_PUT,
HTTP_METHOD_PATCH,
HTTP_METHOD_DELETE,
HTTP_METHOD_COPY,
HTTP_METHOD_MOVE,
HTTP_METHOD_PROPPATCH,
HTTP_METHOD_REPORT, /* DeltaV */
HTTP_METHOD_CHECKOUT,
HTTP_METHOD_CHECKIN,
HTTP_METHOD_VERSION_CONTROL,
HTTP_METHOD_UNCHECKOUT,
HTTP_METHOD_MKACTIVITY,
HTTP_METHOD_MERGE,
HTTP_METHOD_LOCK,
HTTP_METHOD_UNLOCK,
HTTP_METHOD_LABEL,
HTTP_METHOD_CONNECT
HTTP_METHOD_GET, /* [RFC2616], Section 9.3 */
HTTP_METHOD_HEAD, /* [RFC2616], Section 9.4 */
HTTP_METHOD_POST, /* [RFC2616], Section 9.5 */
HTTP_METHOD_PUT, /* [RFC2616], Section 9.6 */
HTTP_METHOD_DELETE, /* [RFC2616], Section 9.7 */
HTTP_METHOD_CONNECT, /* [RFC2616], Section 9.9 */
HTTP_METHOD_OPTIONS, /* [RFC2616], Section 9.2 */
HTTP_METHOD_TRACE, /* [RFC2616], Section 9.8 */
HTTP_METHOD_ACL, /* [RFC3744], Section 8.1 */
HTTP_METHOD_BASELINE_CONTROL, /* [RFC3253], Section 12.6 */
HTTP_METHOD_BIND, /* [RFC5842], Section 4 */
HTTP_METHOD_CHECKIN, /* [RFC3253], Section 4.4 and [RFC3253], Section 9.4 */
HTTP_METHOD_CHECKOUT, /* [RFC3253], Section 4.3 and [RFC3253], Section 8.8 */
HTTP_METHOD_COPY, /* [RFC4918], Section 9.8 */
HTTP_METHOD_LABEL, /* [RFC3253], Section 8.2 */
HTTP_METHOD_LINK, /* [RFC2068], Section 19.6.1.2 */
HTTP_METHOD_LOCK, /* [RFC4918], Section 9.10 */
HTTP_METHOD_MERGE, /* [RFC3253], Section 11.2 */
HTTP_METHOD_MKACTIVITY, /* [RFC3253], Section 13.5 */
HTTP_METHOD_MKCALENDAR, /* [RFC4791], Section 5.3.1 */
HTTP_METHOD_MKCOL, /* [RFC4918], Section 9.3 */
HTTP_METHOD_MKREDIRECTREF, /* [RFC4437], Section 6 */
HTTP_METHOD_MKWORKSPACE, /* [RFC3253], Section 6.3 */
HTTP_METHOD_MOVE, /* [RFC4918], Section 9.9 */
HTTP_METHOD_ORDERPATCH, /* [RFC3648], Section 7 */
HTTP_METHOD_PATCH, /* [RFC5789], Section 2 */
HTTP_METHOD_PROPFIND, /* [RFC4918], Section 9.1 */
HTTP_METHOD_PROPPATCH, /* [RFC4918], Section 9.2 */
HTTP_METHOD_REBIND, /* [RFC5842], Section 6 */
HTTP_METHOD_REPORT, /* [RFC3253], Section 3.6 */
HTTP_METHOD_SEARCH, /* [RFC5323], Section 2 */
HTTP_METHOD_UNBIND, /* [RFC5842], Section 5 */
HTTP_METHOD_UNCHECKOUT, /* [RFC3253], Section 4.5 */
HTTP_METHOD_UNLINK, /* [RFC2068], Section 19.6.1.3 */
HTTP_METHOD_UNLOCK, /* [RFC4918], Section 9.11 */
HTTP_METHOD_UPDATE, /* [RFC3253], Section 7.1 */
HTTP_METHOD_UPDATEREDIRECTREF, /* [RFC4437], Section 7 */
HTTP_METHOD_VERSION_CONTROL /* [RFC3253], Section 3.5 */
} http_method_t;
typedef enum { HTTP_VERSION_UNSET = -1, HTTP_VERSION_1_0, HTTP_VERSION_1_1 } http_version_t;

Loading…
Cancel
Save