cosmopolitan/net/http/gethttpmethod.gperf
Justine Tunney 1753b669cf Have redbean show zip listing as default / handler
If an "index.lua" or "index.html" doesn't exist in zip file or the
filesystem, and no redirects have been defined for it either, then
redbean will render a listing of the zip central directory content
only if the request uri points to the root path.
2021-03-29 01:22:49 -07:00

31 lines
667 B
Plaintext

%{
#include "libc/str/str.h"
#include "net/http/http.h"
#define GPERF_DOWNCASE
%}
%compare-strncmp
%ignore-case
%language=ANSI-C
%readonly-tables
%struct-type
%define lookup-function-name LookupHttpMethod
struct HttpMethodSlot { char name[8]; char code; };
%%
DELETE, kHttpDelete
GET, kHttpGet
HEAD, kHttpHead
POST, kHttpPost
PUT, kHttpPut
OPTIONS, kHttpOptions
CONNECT, kHttpConnect
TRACE, kHttpTrace
COPY, kHttpCopy
LOCK, kHttpLock
MERGE, kHttpMerge
MKCOL, kHttpMkcol
MOVE, kHttpMove
NOTIFY, kHttpNotify
PATCH, kHttpPatch
REPORT, kHttpReport
UNLOCK, kHttpUnlock