diff options
Diffstat (limited to 'src/http/method.zig')
-rw-r--r-- | src/http/method.zig | 88 |
1 files changed, 84 insertions, 4 deletions
diff --git a/src/http/method.zig b/src/http/method.zig index 4a3d45133..d2668f1b7 100644 --- a/src/http/method.zig +++ b/src/http/method.zig @@ -11,15 +11,42 @@ const C = bun.C; const std = @import("std"); pub const Method = enum { + ACL, + BIND, + CHECKOUT, + CONNECT, + COPY, + DELETE, GET, HEAD, + LINK, + LOCK, + @"M-SEARCH", + MERGE, + MKACTIVITY, + MKCALENDAR, + MKCOL, + MOVE, + NOTIFY, + OPTIONS, PATCH, - PUT, POST, - OPTIONS, - CONNECT, + PROPFIND, + PROPPATCH, + PURGE, + PUT, + /// https://httpwg.org/http-extensions/draft-ietf-httpbis-safe-method-w-body.html + QUERY, + REBIND, + REPORT, + SEARCH, + SOURCE, + SUBSCRIBE, TRACE, - DELETE, + UNBIND, + UNLINK, + UNLOCK, + UNSUBSCRIBE, const with_body: std.enums.EnumSet(Method) = brk: { var values = std.enums.EnumSet(Method).initFull(); @@ -47,24 +74,77 @@ pub const Method = enum { } const Map = bun.ComptimeStringMap(Method, .{ + .{ "ACL", Method.ACL }, + .{ "BIND", Method.BIND }, + .{ "CHECKOUT", Method.CHECKOUT }, .{ "CONNECT", Method.CONNECT }, + .{ "COPY", Method.COPY }, .{ "DELETE", Method.DELETE }, .{ "GET", Method.GET }, .{ "HEAD", Method.HEAD }, + .{ "LINK", Method.LINK }, + .{ "LOCK", Method.LOCK }, + .{ "M-SEARCH", Method.@"M-SEARCH" }, + .{ "MERGE", Method.MERGE }, + .{ "MKACTIVITY", Method.MKACTIVITY }, + .{ "MKCALENDAR", Method.MKCALENDAR }, + .{ "MKCOL", Method.MKCOL }, + .{ "MOVE", Method.MOVE }, + .{ "NOTIFY", Method.NOTIFY }, .{ "OPTIONS", Method.OPTIONS }, .{ "PATCH", Method.PATCH }, .{ "POST", Method.POST }, + .{ "PROPFIND", Method.PROPFIND }, + .{ "PROPPATCH", Method.PROPPATCH }, + .{ "PURGE", Method.PURGE }, .{ "PUT", Method.PUT }, + .{ "QUERY", Method.QUERY }, + .{ "REBIND", Method.REBIND }, + .{ "REPORT", Method.REPORT }, + .{ "SEARCH", Method.SEARCH }, + .{ "SOURCE", Method.SOURCE }, + .{ "SUBSCRIBE", Method.SUBSCRIBE }, .{ "TRACE", Method.TRACE }, + .{ "UNBIND", Method.UNBIND }, + .{ "UNLINK", Method.UNLINK }, + .{ "UNLOCK", Method.UNLOCK }, + .{ "UNSUBSCRIBE", Method.UNSUBSCRIBE }, + + .{ "acl", Method.ACL }, + .{ "bind", Method.BIND }, + .{ "checkout", Method.CHECKOUT }, .{ "connect", Method.CONNECT }, + .{ "copy", Method.COPY }, .{ "delete", Method.DELETE }, .{ "get", Method.GET }, .{ "head", Method.HEAD }, + .{ "link", Method.LINK }, + .{ "lock", Method.LOCK }, + .{ "m-search", Method.@"M-SEARCH" }, + .{ "merge", Method.MERGE }, + .{ "mkactivity", Method.MKACTIVITY }, + .{ "mkcalendar", Method.MKCALENDAR }, + .{ "mkcol", Method.MKCOL }, + .{ "move", Method.MOVE }, + .{ "notify", Method.NOTIFY }, .{ "options", Method.OPTIONS }, .{ "patch", Method.PATCH }, .{ "post", Method.POST }, + .{ "propfind", Method.PROPFIND }, + .{ "proppatch", Method.PROPPATCH }, + .{ "purge", Method.PURGE }, .{ "put", Method.PUT }, + .{ "query", Method.QUERY }, + .{ "rebind", Method.REBIND }, + .{ "report", Method.REPORT }, + .{ "search", Method.SEARCH }, + .{ "source", Method.SOURCE }, + .{ "subscribe", Method.SUBSCRIBE }, .{ "trace", Method.TRACE }, + .{ "unbind", Method.UNBIND }, + .{ "unlink", Method.UNLINK }, + .{ "unlock", Method.UNLOCK }, + .{ "unsubscribe", Method.UNSUBSCRIBE }, }); pub fn which(str: []const u8) ?Method { |