mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-28 07:18:30 +00:00
Fix bugs and make improvements
- Fix regression with `%lu` - Added some more headers witnessed in the wild - Added `-M INT` option to redbean to tune max payload size - Work around InfoZIP 256 character limit on comment line size
This commit is contained in:
parent
3aa8983ec1
commit
1966369e8e
17 changed files with 574 additions and 415 deletions
|
@ -11,68 +11,77 @@
|
|||
%define lookup-function-name LookupHttpHeader
|
||||
struct thatispacked HttpHeaderSlot { char *name; char code; };
|
||||
%%
|
||||
Accept, kHttpAccept
|
||||
Accept-Charset, kHttpAcceptCharset
|
||||
Accept-Encoding, kHttpAcceptEncoding
|
||||
Accept-Language, kHttpAcceptLanguage
|
||||
Age, kHttpAge
|
||||
Allow, kHttpAllow
|
||||
Authorization, kHttpAuthorization
|
||||
Host, kHttpHost
|
||||
Cache-Control, kHttpCacheControl
|
||||
Chunked, kHttpChunked
|
||||
Link, kHttpLink
|
||||
Connection, kHttpConnection
|
||||
Content-Base, kHttpContentBase
|
||||
Content-Encoding, kHttpContentEncoding
|
||||
Content-Language, kHttpContentLanguage
|
||||
Accept, kHttpAccept
|
||||
Accept-Language, kHttpAcceptLanguage
|
||||
Accept-Encoding, kHttpAcceptEncoding
|
||||
User-Agent, kHttpUserAgent
|
||||
Referer, kHttpReferer
|
||||
X-Forwarded-For, kHttpXForwardedFor
|
||||
Origin, kHttpOrigin
|
||||
Upgrade-Insecure-Requests, kHttpUpgradeInsecureRequests
|
||||
Pragma, kHttpPragma
|
||||
Cookie, kHttpCookie
|
||||
DNT, kHttpDnt
|
||||
Sec-GPC, kHttpSecGpc
|
||||
From, kHttpFrom
|
||||
If-Modified-Since, kHttpIfModifiedSince
|
||||
X-Requested-With, kHttpXRequestedWith
|
||||
X-Forwarded-Host, kHttpXForwardedHost
|
||||
X-Forwarded-Proto, kHttpXForwardedProto
|
||||
X-CSRF-Token, kHttpXCsrfToken
|
||||
Save-Data, kHttpSaveData
|
||||
Range, kHttpRange
|
||||
Content-Length, kHttpContentLength
|
||||
Content-Type, kHttpContentType
|
||||
Vary, kHttpVary
|
||||
Date, kHttpDate
|
||||
Server, kHttpServer
|
||||
Expires, kHttpExpires
|
||||
Content-Encoding, kHttpContentEncoding
|
||||
Last-Modified, kHttpLastModified
|
||||
ETag, kHttpEtag
|
||||
Allow, kHttpAllow
|
||||
Content-Range, kHttpContentRange
|
||||
Accept-Charset, kHttpAcceptCharset
|
||||
Access-Control-Allow-Credentials, kHttpAccessControlAllowCredentials
|
||||
Access-Control-Allow-Headers, kHttpAccessControlAllowHeaders
|
||||
Access-Control-Allow-Methods, kHttpAccessControlAllowMethods
|
||||
Access-Control-Allow-Origin, kHttpAccessControlAllowOrigin
|
||||
Access-Control-MaxAge, kHttpAccessControlMaxAge
|
||||
Access-Control-Method, kHttpAccessControlMethod
|
||||
Access-Control-RequestHeaders, kHttpAccessControlRequestHeaders
|
||||
Access-Control-Request-Method, kHttpAccessControlRequestMethod
|
||||
Access-Control-Request-Methods, kHttpAccessControlRequestMethods
|
||||
Age, kHttpAge
|
||||
Authorization, kHttpAuthorization
|
||||
Content-Base, kHttpContentBase
|
||||
Content-Description, kHttpContentDescription
|
||||
Content-Disposition, kHttpContentDisposition
|
||||
Content-Language, kHttpContentLanguage
|
||||
Content-Location, kHttpContentLocation
|
||||
Content-MD5, kHttpContentMd5
|
||||
Content-Range, kHttpContentRange
|
||||
Content-Type, kHttpContentType
|
||||
Date, kHttpDate
|
||||
ETag, kHttpEtag
|
||||
Expires, kHttpExpires
|
||||
From, kHttpFrom
|
||||
Host, kHttpHost
|
||||
Expect, kHttpExpect
|
||||
If-Match, kHttpIfMatch
|
||||
If-Modified-Since, kHttpIfModifiedSince
|
||||
If-None-Match, kHttpIfNoneMatch
|
||||
If-Range, kHttpIfRange
|
||||
If-Unmodified-Since, kHttpIfUnmodifiedSince
|
||||
Keep-Alive, kHttpKeepAlive
|
||||
Link, kHttpLink
|
||||
Location, kHttpLocation
|
||||
Max-Forwards, kHttpMaxForwards
|
||||
Pragma, kHttpPragma
|
||||
Proxy-Authenticate, kHttpProxyAuthenticate
|
||||
Proxy-Authorization, kHttpProxyAuthorization
|
||||
Proxy-Connection, kHttpProxyConnection
|
||||
Range, kHttpRange
|
||||
Referer, kHttpReferer
|
||||
Transfer-Encoding, kHttpTransferEncoding
|
||||
Upgrade, kHttpUpgrade
|
||||
User-Agent, kHttpUserAgent
|
||||
Via, kHttpVia
|
||||
Location, kHttpLocation
|
||||
Public, kHttpPublic
|
||||
Retry-After, kHttpRetryAfter
|
||||
Server, kHttpServer
|
||||
Vary, kHttpVary
|
||||
TE, kHttpTe
|
||||
Trailer, kHttpTrailer
|
||||
Transfer-Encoding, kHttpTransferEncoding
|
||||
Upgrade, kHttpUpgrade
|
||||
Uri, kHttpUri
|
||||
Warning, kHttpWarning
|
||||
WWW-Authenticate, kHttpWwwAuthenticate
|
||||
Last-Modified, kHttpLastModified
|
||||
Trailer, kHttpTrailer
|
||||
TE, kHttpTe
|
||||
DNT, kHttpDnt
|
||||
Expect, kHttpExpect
|
||||
Content-Disposition, kHttpContentDisposition
|
||||
Content-Description, kHttpContentDescription
|
||||
Origin, kHttpOrigin
|
||||
Upgrade-Insecure-Requests, kHttpUpgradeInsecureRequests
|
||||
URI, kHttpUri
|
||||
X-Csrf-Token, kHttpXCsrfToken
|
||||
X-Forwarded-For, kHttpXForwardedFor
|
||||
X-Forwarded-Host, kHttpXForwardedHost
|
||||
X-Forwarded-Proto, kHttpXForwardedProto
|
||||
X-Requested-With, kHttpXRequestedWith
|
||||
Access-Control-Request-Method, kHttpAccessControlRequestMethod
|
||||
Access-Control-Request-Headers, kHttpAccessControlRequestHeaders
|
||||
Via, kHttpVia
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* ANSI-C code produced by gperf version 3.1 */
|
||||
/* Command-line: gperf gethttpheader.gperf */
|
||||
/* Computed positions: -k'3-4,10' */
|
||||
/* Computed positions: -k'1,10,22,$' */
|
||||
/* clang-format off */
|
||||
|
||||
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
|
||||
|
@ -38,12 +38,12 @@
|
|||
#line 12 "gethttpheader.gperf"
|
||||
struct thatispacked HttpHeaderSlot { char *name; char code; };
|
||||
|
||||
#define TOTAL_KEYWORDS 65
|
||||
#define TOTAL_KEYWORDS 73
|
||||
#define MIN_WORD_LENGTH 2
|
||||
#define MAX_WORD_LENGTH 30
|
||||
#define MIN_HASH_VALUE 2
|
||||
#define MAX_HASH_VALUE 102
|
||||
/* maximum key range = 101, duplicates = 0 */
|
||||
#define MAX_WORD_LENGTH 32
|
||||
#define MIN_HASH_VALUE 6
|
||||
#define MAX_HASH_VALUE 142
|
||||
/* maximum key range = 137, duplicates = 0 */
|
||||
|
||||
#ifndef GPERF_DOWNCASE
|
||||
#define GPERF_DOWNCASE 1
|
||||
|
@ -102,38 +102,52 @@ hash (register const char *str, register size_t len)
|
|||
{
|
||||
static const unsigned char asso_values[] =
|
||||
{
|
||||
103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
|
||||
103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
|
||||
103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
|
||||
103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
|
||||
103, 103, 103, 103, 103, 30, 103, 103, 103, 103,
|
||||
103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
|
||||
103, 103, 103, 103, 103, 10, 0, 10, 0, 5,
|
||||
0, 15, 25, 30, 103, 0, 0, 5, 0, 45,
|
||||
65, 103, 20, 55, 0, 30, 15, 10, 10, 40,
|
||||
103, 103, 103, 103, 103, 103, 103, 10, 0, 10,
|
||||
0, 5, 0, 15, 25, 30, 103, 0, 0, 5,
|
||||
0, 45, 65, 103, 20, 55, 0, 30, 15, 10,
|
||||
10, 40, 103, 103, 103, 103, 103, 103, 103, 103,
|
||||
103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
|
||||
103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
|
||||
103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
|
||||
103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
|
||||
103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
|
||||
103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
|
||||
103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
|
||||
103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
|
||||
103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
|
||||
103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
|
||||
103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
|
||||
103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
|
||||
103, 103, 103, 103, 103, 103
|
||||
143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
|
||||
143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
|
||||
143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
|
||||
143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
|
||||
143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
|
||||
143, 143, 143, 0, 143, 143, 143, 143, 143, 143,
|
||||
143, 143, 143, 143, 143, 0, 143, 20, 75, 5,
|
||||
35, 30, 15, 30, 143, 55, 15, 40, 0, 65,
|
||||
30, 143, 35, 20, 0, 50, 10, 30, 55, 45,
|
||||
143, 143, 143, 143, 143, 143, 143, 0, 143, 20,
|
||||
75, 5, 35, 30, 15, 30, 143, 55, 15, 40,
|
||||
0, 65, 30, 143, 35, 20, 0, 50, 10, 30,
|
||||
55, 45, 143, 143, 143, 143, 143, 143, 143, 143,
|
||||
143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
|
||||
143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
|
||||
143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
|
||||
143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
|
||||
143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
|
||||
143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
|
||||
143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
|
||||
143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
|
||||
143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
|
||||
143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
|
||||
143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
|
||||
143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
|
||||
143, 143, 143, 143, 143, 143
|
||||
};
|
||||
register unsigned int hval = len;
|
||||
|
||||
switch (hval)
|
||||
{
|
||||
default:
|
||||
hval += asso_values[(unsigned char)str[21]];
|
||||
/*FALLTHROUGH*/
|
||||
case 21:
|
||||
case 20:
|
||||
case 19:
|
||||
case 18:
|
||||
case 17:
|
||||
case 16:
|
||||
case 15:
|
||||
case 14:
|
||||
case 13:
|
||||
case 12:
|
||||
case 11:
|
||||
case 10:
|
||||
hval += asso_values[(unsigned char)str[9]];
|
||||
/*FALLTHROUGH*/
|
||||
case 9:
|
||||
|
@ -142,15 +156,13 @@ hash (register const char *str, register size_t len)
|
|||
case 6:
|
||||
case 5:
|
||||
case 4:
|
||||
hval += asso_values[(unsigned char)str[3]];
|
||||
/*FALLTHROUGH*/
|
||||
case 3:
|
||||
hval += asso_values[(unsigned char)str[2]];
|
||||
/*FALLTHROUGH*/
|
||||
case 2:
|
||||
case 1:
|
||||
hval += asso_values[(unsigned char)str[0]];
|
||||
break;
|
||||
}
|
||||
return hval;
|
||||
return hval + asso_values[(unsigned char)str[len - 1]];
|
||||
}
|
||||
|
||||
static inline const struct thatispacked HttpHeaderSlot *
|
||||
|
@ -158,152 +170,178 @@ LookupHttpHeader (register const char *str, register size_t len)
|
|||
{
|
||||
static const struct thatispacked HttpHeaderSlot wordlist[] =
|
||||
{
|
||||
{""}, {""},
|
||||
#line 64 "gethttpheader.gperf"
|
||||
{"TE", kHttpTe},
|
||||
#line 65 "gethttpheader.gperf"
|
||||
{"DNT", kHttpDnt},
|
||||
#line 23 "gethttpheader.gperf"
|
||||
{"Link", kHttpLink},
|
||||
{""},
|
||||
#line 56 "gethttpheader.gperf"
|
||||
{"Public", kHttpPublic},
|
||||
{""},
|
||||
#line 18 "gethttpheader.gperf"
|
||||
{"Age", kHttpAge},
|
||||
#line 33 "gethttpheader.gperf"
|
||||
{"Date", kHttpDate},
|
||||
#line 24 "gethttpheader.gperf"
|
||||
{"Connection", kHttpConnection},
|
||||
#line 30 "gethttpheader.gperf"
|
||||
{"Content-MD5", kHttpContentMd5},
|
||||
#line 50 "gethttpheader.gperf"
|
||||
{"Referer", kHttpReferer},
|
||||
#line 54 "gethttpheader.gperf"
|
||||
{"Via", kHttpVia},
|
||||
{""}, {""},
|
||||
#line 26 "gethttpheader.gperf"
|
||||
{"Content-Encoding", kHttpContentEncoding},
|
||||
{""}, {""},
|
||||
#line 28 "gethttpheader.gperf"
|
||||
{"Content-Length", kHttpContentLength},
|
||||
#line 49 "gethttpheader.gperf"
|
||||
{"Range", kHttpRange},
|
||||
#line 14 "gethttpheader.gperf"
|
||||
{"Accept", kHttpAccept},
|
||||
#line 25 "gethttpheader.gperf"
|
||||
{"Content-Base", kHttpContentBase},
|
||||
#line 31 "gethttpheader.gperf"
|
||||
{"Content-Range", kHttpContentRange},
|
||||
#line 68 "gethttpheader.gperf"
|
||||
{"Content-Description", kHttpContentDescription},
|
||||
{""},
|
||||
#line 27 "gethttpheader.gperf"
|
||||
{"Content-Language", kHttpContentLanguage},
|
||||
#line 60 "gethttpheader.gperf"
|
||||
{"Warning", kHttpWarning},
|
||||
#line 55 "gethttpheader.gperf"
|
||||
{"Location", kHttpLocation},
|
||||
#line 34 "gethttpheader.gperf"
|
||||
{"ETag", kHttpEtag},
|
||||
{""}, {""}, {""}, {""}, {""}, {""},
|
||||
#line 17 "gethttpheader.gperf"
|
||||
{"Accept-Language", kHttpAcceptLanguage},
|
||||
#line 45 "gethttpheader.gperf"
|
||||
{"Pragma", kHttpPragma},
|
||||
#line 51 "gethttpheader.gperf"
|
||||
{"Transfer-Encoding", kHttpTransferEncoding},
|
||||
#line 71 "gethttpheader.gperf"
|
||||
{"URI", kHttpUri},
|
||||
{""},
|
||||
#line 53 "gethttpheader.gperf"
|
||||
{"User-Agent", kHttpUserAgent},
|
||||
#line 57 "gethttpheader.gperf"
|
||||
{"Retry-After", kHttpRetryAfter},
|
||||
#line 22 "gethttpheader.gperf"
|
||||
{"Chunked", kHttpChunked},
|
||||
#line 20 "gethttpheader.gperf"
|
||||
{"Authorization", kHttpAuthorization},
|
||||
#line 15 "gethttpheader.gperf"
|
||||
{"Accept-Charset", kHttpAcceptCharset},
|
||||
#line 16 "gethttpheader.gperf"
|
||||
{"Accept-Encoding", kHttpAcceptEncoding},
|
||||
{"Accept", kHttpAccept},
|
||||
#line 80 "gethttpheader.gperf"
|
||||
{"TE", kHttpTe},
|
||||
#line 58 "gethttpheader.gperf"
|
||||
{"Server", kHttpServer},
|
||||
#line 52 "gethttpheader.gperf"
|
||||
{"Upgrade", kHttpUpgrade},
|
||||
#line 38 "gethttpheader.gperf"
|
||||
{"If-Match", kHttpIfMatch},
|
||||
#line 77 "gethttpheader.gperf"
|
||||
{"Access-Control-Request-Method", kHttpAccessControlRequestMethod},
|
||||
#line 78 "gethttpheader.gperf"
|
||||
{"Access-Control-Request-Headers", kHttpAccessControlRequestHeaders},
|
||||
#line 76 "gethttpheader.gperf"
|
||||
{"X-Requested-With", kHttpXRequestedWith},
|
||||
#line 63 "gethttpheader.gperf"
|
||||
{"Trailer", kHttpTrailer},
|
||||
#line 21 "gethttpheader.gperf"
|
||||
{"Cache-Control", kHttpCacheControl},
|
||||
#line 67 "gethttpheader.gperf"
|
||||
{"Content-Disposition", kHttpContentDisposition},
|
||||
#line 19 "gethttpheader.gperf"
|
||||
{"Allow", kHttpAllow},
|
||||
#line 69 "gethttpheader.gperf"
|
||||
{"Origin", kHttpOrigin},
|
||||
#line 32 "gethttpheader.gperf"
|
||||
{"Content-Type", kHttpContentType},
|
||||
#line 40 "gethttpheader.gperf"
|
||||
{"If-None-Match", kHttpIfNoneMatch},
|
||||
#line 36 "gethttpheader.gperf"
|
||||
{"From", kHttpFrom},
|
||||
{""},
|
||||
#line 61 "gethttpheader.gperf"
|
||||
{"WWW-Authenticate", kHttpWwwAuthenticate},
|
||||
#line 39 "gethttpheader.gperf"
|
||||
{"If-Modified-Since", kHttpIfModifiedSince},
|
||||
#line 41 "gethttpheader.gperf"
|
||||
{"If-Range", kHttpIfRange},
|
||||
#line 37 "gethttpheader.gperf"
|
||||
{"Host", kHttpHost},
|
||||
#line 70 "gethttpheader.gperf"
|
||||
{"Upgrade-Insecure-Requests", kHttpUpgradeInsecureRequests},
|
||||
#line 29 "gethttpheader.gperf"
|
||||
{"Content-Location", kHttpContentLocation},
|
||||
{"Age", kHttpAge},
|
||||
{""}, {""},
|
||||
#line 59 "gethttpheader.gperf"
|
||||
{"Vary", kHttpVary},
|
||||
#line 73 "gethttpheader.gperf"
|
||||
{"X-Forwarded-For", kHttpXForwardedFor},
|
||||
#line 74 "gethttpheader.gperf"
|
||||
{"X-Forwarded-Host", kHttpXForwardedHost},
|
||||
#line 75 "gethttpheader.gperf"
|
||||
{"X-Forwarded-Proto", kHttpXForwardedProto},
|
||||
#line 62 "gethttpheader.gperf"
|
||||
{"Last-Modified", kHttpLastModified},
|
||||
{""}, {""},
|
||||
#line 48 "gethttpheader.gperf"
|
||||
{"Proxy-Connection", kHttpProxyConnection},
|
||||
#line 44 "gethttpheader.gperf"
|
||||
{"Max-Forwards", kHttpMaxForwards},
|
||||
{""}, {""}, {""},
|
||||
#line 66 "gethttpheader.gperf"
|
||||
{"Expect", kHttpExpect},
|
||||
#line 72 "gethttpheader.gperf"
|
||||
{"X-Csrf-Token", kHttpXCsrfToken},
|
||||
{""},
|
||||
#line 42 "gethttpheader.gperf"
|
||||
{"If-Unmodified-Since", kHttpIfUnmodifiedSince},
|
||||
{""}, {""}, {""}, {""}, {""},
|
||||
#line 43 "gethttpheader.gperf"
|
||||
{"Keep-Alive", kHttpKeepAlive},
|
||||
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
|
||||
{""}, {""}, {""},
|
||||
#line 46 "gethttpheader.gperf"
|
||||
{"Proxy-Authenticate", kHttpProxyAuthenticate},
|
||||
#line 47 "gethttpheader.gperf"
|
||||
{"Proxy-Authorization", kHttpProxyAuthorization},
|
||||
#line 59 "gethttpheader.gperf"
|
||||
{"Authorization", kHttpAuthorization},
|
||||
#line 48 "gethttpheader.gperf"
|
||||
{"Accept-Charset", kHttpAcceptCharset},
|
||||
{""}, {""}, {""}, {""},
|
||||
#line 14 "gethttpheader.gperf"
|
||||
{"Host", kHttpHost},
|
||||
#line 18 "gethttpheader.gperf"
|
||||
{"Accept-Language", kHttpAcceptLanguage},
|
||||
{""}, {""},
|
||||
#line 73 "gethttpheader.gperf"
|
||||
{"Location", kHttpLocation},
|
||||
{""}, {""},
|
||||
#line 53 "gethttpheader.gperf"
|
||||
{"Access-Control-MaxAge", kHttpAccessControlMaxAge},
|
||||
{""}, {""},
|
||||
#line 35 "gethttpheader.gperf"
|
||||
{"Expires", kHttpExpires}
|
||||
{"Save-Data", kHttpSaveData},
|
||||
#line 16 "gethttpheader.gperf"
|
||||
{"Connection", kHttpConnection},
|
||||
#line 26 "gethttpheader.gperf"
|
||||
{"Cookie", kHttpCookie},
|
||||
#line 42 "gethttpheader.gperf"
|
||||
{"Expires", kHttpExpires},
|
||||
{""}, {""},
|
||||
#line 46 "gethttpheader.gperf"
|
||||
{"Allow", kHttpAllow},
|
||||
#line 25 "gethttpheader.gperf"
|
||||
{"Pragma", kHttpPragma},
|
||||
#line 60 "gethttpheader.gperf"
|
||||
{"Content-Base", kHttpContentBase},
|
||||
#line 47 "gethttpheader.gperf"
|
||||
{"Content-Range", kHttpContentRange},
|
||||
#line 45 "gethttpheader.gperf"
|
||||
{"ETag", kHttpEtag},
|
||||
{""},
|
||||
#line 63 "gethttpheader.gperf"
|
||||
{"Content-Language", kHttpContentLanguage},
|
||||
#line 81 "gethttpheader.gperf"
|
||||
{"Trailer", kHttpTrailer},
|
||||
#line 69 "gethttpheader.gperf"
|
||||
{"If-Range", kHttpIfRange},
|
||||
#line 61 "gethttpheader.gperf"
|
||||
{"Content-Description", kHttpContentDescription},
|
||||
#line 36 "gethttpheader.gperf"
|
||||
{"Range", kHttpRange},
|
||||
#line 77 "gethttpheader.gperf"
|
||||
{"Proxy-Connection", kHttpProxyConnection},
|
||||
#line 28 "gethttpheader.gperf"
|
||||
{"Sec-GPC", kHttpSecGpc},
|
||||
#line 15 "gethttpheader.gperf"
|
||||
{"Cache-Control", kHttpCacheControl},
|
||||
#line 55 "gethttpheader.gperf"
|
||||
{"Access-Control-RequestHeaders", kHttpAccessControlRequestHeaders},
|
||||
#line 57 "gethttpheader.gperf"
|
||||
{"Access-Control-Request-Methods", kHttpAccessControlRequestMethods},
|
||||
#line 86 "gethttpheader.gperf"
|
||||
{"WWW-Authenticate", kHttpWwwAuthenticate},
|
||||
#line 82 "gethttpheader.gperf"
|
||||
{"Transfer-Encoding", kHttpTransferEncoding},
|
||||
#line 67 "gethttpheader.gperf"
|
||||
{"If-Match", kHttpIfMatch},
|
||||
#line 37 "gethttpheader.gperf"
|
||||
{"Content-Length", kHttpContentLength},
|
||||
{""},
|
||||
#line 78 "gethttpheader.gperf"
|
||||
{"Public", kHttpPublic},
|
||||
#line 30 "gethttpheader.gperf"
|
||||
{"If-Modified-Since", kHttpIfModifiedSince},
|
||||
#line 68 "gethttpheader.gperf"
|
||||
{"If-None-Match", kHttpIfNoneMatch},
|
||||
#line 39 "gethttpheader.gperf"
|
||||
{"Vary", kHttpVary},
|
||||
#line 20 "gethttpheader.gperf"
|
||||
{"User-Agent", kHttpUserAgent},
|
||||
#line 41 "gethttpheader.gperf"
|
||||
{"Server", kHttpServer},
|
||||
#line 83 "gethttpheader.gperf"
|
||||
{"Upgrade", kHttpUpgrade},
|
||||
#line 50 "gethttpheader.gperf"
|
||||
{"Access-Control-Allow-Headers", kHttpAccessControlAllowHeaders},
|
||||
#line 76 "gethttpheader.gperf"
|
||||
{"Proxy-Authorization", kHttpProxyAuthorization},
|
||||
#line 19 "gethttpheader.gperf"
|
||||
{"Accept-Encoding", kHttpAcceptEncoding},
|
||||
#line 43 "gethttpheader.gperf"
|
||||
{"Content-Encoding", kHttpContentEncoding},
|
||||
#line 85 "gethttpheader.gperf"
|
||||
{"Warning", kHttpWarning},
|
||||
#line 75 "gethttpheader.gperf"
|
||||
{"Proxy-Authenticate", kHttpProxyAuthenticate},
|
||||
#line 62 "gethttpheader.gperf"
|
||||
{"Content-Disposition", kHttpContentDisposition},
|
||||
{""},
|
||||
#line 23 "gethttpheader.gperf"
|
||||
{"Origin", kHttpOrigin},
|
||||
#line 49 "gethttpheader.gperf"
|
||||
{"Access-Control-Allow-Credentials", kHttpAccessControlAllowCredentials},
|
||||
{""},
|
||||
#line 72 "gethttpheader.gperf"
|
||||
{"Link", kHttpLink},
|
||||
#line 71 "gethttpheader.gperf"
|
||||
{"Keep-Alive", kHttpKeepAlive},
|
||||
#line 32 "gethttpheader.gperf"
|
||||
{"X-Forwarded-Host", kHttpXForwardedHost},
|
||||
#line 21 "gethttpheader.gperf"
|
||||
{"Referer", kHttpReferer},
|
||||
#line 27 "gethttpheader.gperf"
|
||||
{"DNT", kHttpDnt},
|
||||
#line 29 "gethttpheader.gperf"
|
||||
{"From", kHttpFrom},
|
||||
{""}, {""},
|
||||
#line 38 "gethttpheader.gperf"
|
||||
{"Content-Type", kHttpContentType},
|
||||
#line 84 "gethttpheader.gperf"
|
||||
{"Uri", kHttpUri},
|
||||
#line 40 "gethttpheader.gperf"
|
||||
{"Date", kHttpDate},
|
||||
{""},
|
||||
#line 79 "gethttpheader.gperf"
|
||||
{"Retry-After", kHttpRetryAfter},
|
||||
{""},
|
||||
#line 51 "gethttpheader.gperf"
|
||||
{"Access-Control-Allow-Methods", kHttpAccessControlAllowMethods},
|
||||
#line 70 "gethttpheader.gperf"
|
||||
{"If-Unmodified-Since", kHttpIfUnmodifiedSince},
|
||||
{""},
|
||||
#line 31 "gethttpheader.gperf"
|
||||
{"X-Requested-With", kHttpXRequestedWith},
|
||||
#line 52 "gethttpheader.gperf"
|
||||
{"Access-Control-Allow-Origin", kHttpAccessControlAllowOrigin},
|
||||
{""}, {""}, {""},
|
||||
#line 54 "gethttpheader.gperf"
|
||||
{"Access-Control-Method", kHttpAccessControlMethod},
|
||||
{""}, {""}, {""},
|
||||
#line 24 "gethttpheader.gperf"
|
||||
{"Upgrade-Insecure-Requests", kHttpUpgradeInsecureRequests},
|
||||
#line 64 "gethttpheader.gperf"
|
||||
{"Content-Location", kHttpContentLocation},
|
||||
{""}, {""},
|
||||
#line 56 "gethttpheader.gperf"
|
||||
{"Access-Control-Request-Method", kHttpAccessControlRequestMethod},
|
||||
{""},
|
||||
#line 65 "gethttpheader.gperf"
|
||||
{"Content-MD5", kHttpContentMd5},
|
||||
#line 74 "gethttpheader.gperf"
|
||||
{"Max-Forwards", kHttpMaxForwards},
|
||||
{""}, {""},
|
||||
#line 22 "gethttpheader.gperf"
|
||||
{"X-Forwarded-For", kHttpXForwardedFor},
|
||||
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
|
||||
{""}, {""},
|
||||
#line 34 "gethttpheader.gperf"
|
||||
{"X-CSRF-Token", kHttpXCsrfToken},
|
||||
{""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
|
||||
{""}, {""}, {""}, {""}, {""}, {""},
|
||||
#line 44 "gethttpheader.gperf"
|
||||
{"Last-Modified", kHttpLastModified},
|
||||
{""}, {""}, {""},
|
||||
#line 33 "gethttpheader.gperf"
|
||||
{"X-Forwarded-Proto", kHttpXForwardedProto}
|
||||
};
|
||||
|
||||
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
|
||||
|
|
|
@ -20,58 +20,114 @@
|
|||
|
||||
const char *GetHttpHeaderName(int h) {
|
||||
switch (h) {
|
||||
case kHttpAccept:
|
||||
return "Accept";
|
||||
case kHttpAcceptCharset:
|
||||
return "Accept-Charset";
|
||||
case kHttpAcceptEncoding:
|
||||
return "Accept-Encoding";
|
||||
case kHttpAcceptLanguage:
|
||||
return "Accept-Language";
|
||||
case kHttpAge:
|
||||
return "Age";
|
||||
case kHttpAllow:
|
||||
return "Allow";
|
||||
case kHttpAuthorization:
|
||||
return "Authorization";
|
||||
case kHttpHost:
|
||||
return "Host";
|
||||
case kHttpCacheControl:
|
||||
return "Cache-Control";
|
||||
case kHttpChunked:
|
||||
return "Chunked";
|
||||
case kHttpLink:
|
||||
return "Link";
|
||||
case kHttpConnection:
|
||||
return "Connection";
|
||||
case kHttpContentBase:
|
||||
return "Content-Base";
|
||||
case kHttpContentEncoding:
|
||||
return "Content-Encoding";
|
||||
case kHttpContentLanguage:
|
||||
return "Content-Language";
|
||||
case kHttpAccept:
|
||||
return "Accept";
|
||||
case kHttpAcceptLanguage:
|
||||
return "Accept-Language";
|
||||
case kHttpAcceptEncoding:
|
||||
return "Accept-Encoding";
|
||||
case kHttpUserAgent:
|
||||
return "User-Agent";
|
||||
case kHttpReferer:
|
||||
return "Referer";
|
||||
case kHttpXForwardedFor:
|
||||
return "X-Forwarded-For";
|
||||
case kHttpOrigin:
|
||||
return "Origin";
|
||||
case kHttpUpgradeInsecureRequests:
|
||||
return "Upgrade-Insecure-Requests";
|
||||
case kHttpPragma:
|
||||
return "Pragma";
|
||||
case kHttpCookie:
|
||||
return "Cookie";
|
||||
case kHttpDnt:
|
||||
return "DNT";
|
||||
case kHttpSecGpc:
|
||||
return "Sec-GPC";
|
||||
case kHttpFrom:
|
||||
return "From";
|
||||
case kHttpIfModifiedSince:
|
||||
return "If-Modified-Since";
|
||||
case kHttpXRequestedWith:
|
||||
return "X-Requested-With";
|
||||
case kHttpXForwardedHost:
|
||||
return "X-Forwarded-Host";
|
||||
case kHttpXForwardedProto:
|
||||
return "X-Forwarded-Proto";
|
||||
case kHttpXCsrfToken:
|
||||
return "X-CSRF-Token";
|
||||
case kHttpSaveData:
|
||||
return "Save-Data";
|
||||
case kHttpRange:
|
||||
return "Range";
|
||||
case kHttpContentLength:
|
||||
return "Content-Length";
|
||||
case kHttpContentType:
|
||||
return "Content-Type";
|
||||
case kHttpVary:
|
||||
return "Vary";
|
||||
case kHttpDate:
|
||||
return "Date";
|
||||
case kHttpServer:
|
||||
return "Server";
|
||||
case kHttpExpires:
|
||||
return "Expires";
|
||||
case kHttpContentEncoding:
|
||||
return "Content-Encoding";
|
||||
case kHttpLastModified:
|
||||
return "Last-Modified";
|
||||
case kHttpEtag:
|
||||
return "ETag";
|
||||
case kHttpAllow:
|
||||
return "Allow";
|
||||
case kHttpContentRange:
|
||||
return "Content-Range";
|
||||
case kHttpAcceptCharset:
|
||||
return "Accept-Charset";
|
||||
case kHttpAccessControlAllowCredentials:
|
||||
return "Access-Control-Allow-Credentials";
|
||||
case kHttpAccessControlAllowHeaders:
|
||||
return "Access-Control-Allow-Headers";
|
||||
case kHttpAccessControlAllowMethods:
|
||||
return "Access-Control-Allow-Methods";
|
||||
case kHttpAccessControlAllowOrigin:
|
||||
return "Access-Control-Allow-Origin";
|
||||
case kHttpAccessControlMaxAge:
|
||||
return "Access-Control-MaxAge";
|
||||
case kHttpAccessControlMethod:
|
||||
return "Access-Control-Method";
|
||||
case kHttpAccessControlRequestHeaders:
|
||||
return "Access-Control-RequestHeaders";
|
||||
case kHttpAccessControlRequestMethod:
|
||||
return "Access-Control-Request-Method";
|
||||
case kHttpAccessControlRequestMethods:
|
||||
return "Access-Control-Request-Methods";
|
||||
case kHttpAge:
|
||||
return "Age";
|
||||
case kHttpAuthorization:
|
||||
return "Authorization";
|
||||
case kHttpContentBase:
|
||||
return "Content-Base";
|
||||
case kHttpContentDescription:
|
||||
return "Content-Description";
|
||||
case kHttpContentDisposition:
|
||||
return "Content-Disposition";
|
||||
case kHttpContentLanguage:
|
||||
return "Content-Language";
|
||||
case kHttpContentLocation:
|
||||
return "Content-Location";
|
||||
case kHttpContentMd5:
|
||||
return "Content-MD5";
|
||||
case kHttpContentRange:
|
||||
return "Content-Range";
|
||||
case kHttpContentType:
|
||||
return "Content-Type";
|
||||
case kHttpDate:
|
||||
return "Date";
|
||||
case kHttpEtag:
|
||||
return "ETag";
|
||||
case kHttpExpires:
|
||||
return "Expires";
|
||||
case kHttpFrom:
|
||||
return "From";
|
||||
case kHttpHost:
|
||||
return "Host";
|
||||
case kHttpExpect:
|
||||
return "Expect";
|
||||
case kHttpIfMatch:
|
||||
return "If-Match";
|
||||
case kHttpIfModifiedSince:
|
||||
return "If-Modified-Since";
|
||||
case kHttpIfNoneMatch:
|
||||
return "If-None-Match";
|
||||
case kHttpIfRange:
|
||||
|
@ -80,76 +136,38 @@ const char *GetHttpHeaderName(int h) {
|
|||
return "If-Unmodified-Since";
|
||||
case kHttpKeepAlive:
|
||||
return "Keep-Alive";
|
||||
case kHttpLink:
|
||||
return "Link";
|
||||
case kHttpLocation:
|
||||
return "Location";
|
||||
case kHttpMaxForwards:
|
||||
return "Max-Forwards";
|
||||
case kHttpPragma:
|
||||
return "Pragma";
|
||||
case kHttpProxyAuthenticate:
|
||||
return "Proxy-Authenticate";
|
||||
case kHttpProxyAuthorization:
|
||||
return "Proxy-Authorization";
|
||||
case kHttpProxyConnection:
|
||||
return "Proxy-Connection";
|
||||
case kHttpRange:
|
||||
return "Range";
|
||||
case kHttpReferer:
|
||||
return "Referer";
|
||||
case kHttpTransferEncoding:
|
||||
return "Transfer-Encoding";
|
||||
case kHttpUpgrade:
|
||||
return "Upgrade";
|
||||
case kHttpUserAgent:
|
||||
return "User-Agent";
|
||||
case kHttpVia:
|
||||
return "Via";
|
||||
case kHttpLocation:
|
||||
return "Location";
|
||||
case kHttpPublic:
|
||||
return "Public";
|
||||
case kHttpRetryAfter:
|
||||
return "Retry-After";
|
||||
case kHttpServer:
|
||||
return "Server";
|
||||
case kHttpVary:
|
||||
return "Vary";
|
||||
case kHttpTe:
|
||||
return "TE";
|
||||
case kHttpTrailer:
|
||||
return "Trailer";
|
||||
case kHttpTransferEncoding:
|
||||
return "Transfer-Encoding";
|
||||
case kHttpUpgrade:
|
||||
return "Upgrade";
|
||||
case kHttpUri:
|
||||
return "Uri";
|
||||
case kHttpWarning:
|
||||
return "Warning";
|
||||
case kHttpWwwAuthenticate:
|
||||
return "WWW-Authenticate";
|
||||
case kHttpLastModified:
|
||||
return "Last-Modified";
|
||||
case kHttpTrailer:
|
||||
return "Trailer";
|
||||
case kHttpTe:
|
||||
return "TE";
|
||||
case kHttpDnt:
|
||||
return "DNT";
|
||||
case kHttpExpect:
|
||||
return "Expect";
|
||||
case kHttpContentDisposition:
|
||||
return "Content-Disposition";
|
||||
case kHttpContentDescription:
|
||||
return "Content-Description";
|
||||
case kHttpOrigin:
|
||||
return "Origin";
|
||||
case kHttpUpgradeInsecureRequests:
|
||||
return "Upgrade-Insecure-Requests";
|
||||
case kHttpUri:
|
||||
return "URI";
|
||||
case kHttpXCsrfToken:
|
||||
return "X-Csrf-Token";
|
||||
case kHttpXForwardedFor:
|
||||
return "X-Forwarded-For";
|
||||
case kHttpXForwardedHost:
|
||||
return "X-Forwarded-Host";
|
||||
case kHttpXForwardedProto:
|
||||
return "X-Forwarded-Proto";
|
||||
case kHttpXRequestedWith:
|
||||
return "X-Requested-With";
|
||||
case kHttpAccessControlRequestMethod:
|
||||
return "Access-Control-Request-Method";
|
||||
case kHttpAccessControlRequestHeaders:
|
||||
return "Access-Control-Request-Headers";
|
||||
case kHttpVia:
|
||||
return "Via";
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
|
|
141
net/http/http.h
141
net/http/http.h
|
@ -20,72 +20,81 @@
|
|||
#define kHttpReport 16
|
||||
#define kHttpUnlock 17
|
||||
|
||||
#define kHttpAccept 0
|
||||
#define kHttpAcceptCharset 1
|
||||
#define kHttpAcceptEncoding 2
|
||||
#define kHttpAcceptLanguage 3
|
||||
#define kHttpAge 4
|
||||
#define kHttpAllow 5
|
||||
#define kHttpAuthorization 6
|
||||
#define kHttpCacheControl 7
|
||||
#define kHttpChunked 8
|
||||
#define kHttpLink 9
|
||||
#define kHttpConnection 10
|
||||
#define kHttpContentBase 11
|
||||
#define kHttpContentEncoding 12
|
||||
#define kHttpContentLanguage 13
|
||||
#define kHttpContentLength 14
|
||||
#define kHttpContentLocation 15
|
||||
#define kHttpContentMd5 16
|
||||
#define kHttpContentRange 17
|
||||
#define kHttpContentType 18
|
||||
#define kHttpDate 19
|
||||
#define kHttpEtag 20
|
||||
#define kHttpExpires 21
|
||||
#define kHttpFrom 22
|
||||
#define kHttpHost 23
|
||||
#define kHttpIfMatch 24
|
||||
#define kHttpIfModifiedSince 25
|
||||
#define kHttpIfNoneMatch 26
|
||||
#define kHttpIfRange 27
|
||||
#define kHttpIfUnmodifiedSince 28
|
||||
#define kHttpKeepAlive 29
|
||||
#define kHttpMaxForwards 30
|
||||
#define kHttpPragma 31
|
||||
#define kHttpProxyAuthenticate 32
|
||||
#define kHttpProxyAuthorization 33
|
||||
#define kHttpProxyConnection 34
|
||||
#define kHttpRange 35
|
||||
#define kHttpReferer 36
|
||||
#define kHttpTransferEncoding 37
|
||||
#define kHttpUpgrade 38
|
||||
#define kHttpUserAgent 39
|
||||
#define kHttpVia 40
|
||||
#define kHttpLocation 41
|
||||
#define kHttpPublic 42
|
||||
#define kHttpRetryAfter 43
|
||||
#define kHttpServer 44
|
||||
#define kHttpVary 45
|
||||
#define kHttpWarning 46
|
||||
#define kHttpWwwAuthenticate 47
|
||||
#define kHttpLastModified 48
|
||||
#define kHttpTrailer 49
|
||||
#define kHttpTe 50
|
||||
#define kHttpDnt 51
|
||||
#define kHttpExpect 52
|
||||
#define kHttpContentDisposition 53
|
||||
#define kHttpContentDescription 54
|
||||
#define kHttpOrigin 55
|
||||
#define kHttpUpgradeInsecureRequests 56
|
||||
#define kHttpUri 57
|
||||
#define kHttpXCsrfToken 58
|
||||
#define kHttpXForwardedFor 59
|
||||
#define kHttpXForwardedHost 60
|
||||
#define kHttpXForwardedProto 61
|
||||
#define kHttpXRequestedWith 62
|
||||
#define kHttpAccessControlRequestMethod 63
|
||||
#define kHttpAccessControlRequestHeaders 64
|
||||
#define kHttpHeadersMax 65
|
||||
#define kHttpHost 0
|
||||
#define kHttpCacheControl 1
|
||||
#define kHttpConnection 2
|
||||
#define kHttpAccept 3
|
||||
#define kHttpAcceptLanguage 4
|
||||
#define kHttpAcceptEncoding 5
|
||||
#define kHttpUserAgent 6
|
||||
#define kHttpReferer 7
|
||||
#define kHttpXForwardedFor 8
|
||||
#define kHttpOrigin 9
|
||||
#define kHttpUpgradeInsecureRequests 10
|
||||
#define kHttpPragma 11
|
||||
#define kHttpCookie 12
|
||||
#define kHttpDnt 13
|
||||
#define kHttpSecGpc 14
|
||||
#define kHttpFrom 15
|
||||
#define kHttpIfModifiedSince 16
|
||||
#define kHttpXRequestedWith 17
|
||||
#define kHttpXForwardedHost 18
|
||||
#define kHttpXForwardedProto 19
|
||||
#define kHttpXCsrfToken 20
|
||||
#define kHttpSaveData 21
|
||||
#define kHttpRange 22
|
||||
#define kHttpContentLength 23
|
||||
#define kHttpContentType 24
|
||||
#define kHttpVary 25
|
||||
#define kHttpDate 26
|
||||
#define kHttpServer 27
|
||||
#define kHttpExpires 28
|
||||
#define kHttpContentEncoding 29
|
||||
#define kHttpLastModified 30
|
||||
#define kHttpEtag 31
|
||||
#define kHttpAllow 32
|
||||
#define kHttpContentRange 33
|
||||
#define kHttpAcceptCharset 34
|
||||
#define kHttpAccessControlAllowCredentials 35
|
||||
#define kHttpAccessControlAllowHeaders 36
|
||||
#define kHttpAccessControlAllowMethods 37
|
||||
#define kHttpAccessControlAllowOrigin 38
|
||||
#define kHttpAccessControlMaxAge 39
|
||||
#define kHttpAccessControlMethod 40
|
||||
#define kHttpAccessControlRequestHeaders 41
|
||||
#define kHttpAccessControlRequestMethod 42
|
||||
#define kHttpAccessControlRequestMethods 43
|
||||
#define kHttpAge 44
|
||||
#define kHttpAuthorization 45
|
||||
#define kHttpContentBase 46
|
||||
#define kHttpContentDescription 47
|
||||
#define kHttpContentDisposition 48
|
||||
#define kHttpContentLanguage 49
|
||||
#define kHttpContentLocation 50
|
||||
#define kHttpContentMd5 51
|
||||
#define kHttpExpect 52
|
||||
#define kHttpIfMatch 53
|
||||
#define kHttpIfNoneMatch 54
|
||||
#define kHttpIfRange 55
|
||||
#define kHttpIfUnmodifiedSince 56
|
||||
#define kHttpKeepAlive 57
|
||||
#define kHttpLink 58
|
||||
#define kHttpLocation 59
|
||||
#define kHttpMaxForwards 60
|
||||
#define kHttpProxyAuthenticate 61
|
||||
#define kHttpProxyAuthorization 62
|
||||
#define kHttpProxyConnection 63
|
||||
#define kHttpPublic 64
|
||||
#define kHttpRetryAfter 65
|
||||
#define kHttpTe 66
|
||||
#define kHttpTrailer 67
|
||||
#define kHttpTransferEncoding 68
|
||||
#define kHttpUpgrade 69
|
||||
#define kHttpUri 70
|
||||
#define kHttpWarning 71
|
||||
#define kHttpWwwAuthenticate 72
|
||||
#define kHttpVia 73
|
||||
#define kHttpHeadersMax 74
|
||||
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
|
|
@ -53,6 +53,7 @@ $(NET_HTTP_A).pkg: \
|
|||
$(NET_HTTP_A_OBJS) \
|
||||
$(foreach x,$(NET_HTTP_A_DIRECTDEPS),$($(x)_A).pkg)
|
||||
|
||||
o/$(MODE)/net/http/gethttpheadername.o \
|
||||
o/$(MODE)/net/http/categorizeip.o \
|
||||
o/$(MODE)/net/http/getipcategoryname.o \
|
||||
o/$(MODE)/net/http/isafrinicip.o \
|
||||
|
|
|
@ -78,4 +78,8 @@ const bool kHttpRepeatable[kHttpHeadersMax] = {
|
|||
[kHttpVia] = true,
|
||||
[kHttpWarning] = true,
|
||||
[kHttpWwwAuthenticate] = true,
|
||||
[kHttpAccessControlAllowHeaders] = true,
|
||||
[kHttpAccessControlAllowMethods] = true,
|
||||
[kHttpAccessControlRequestHeaders] = true,
|
||||
[kHttpAccessControlRequestMethods] = true,
|
||||
};
|
||||
|
|
|
@ -269,9 +269,10 @@ static char *ParseUrlImpl(const char *data, size_t size, struct Url *h,
|
|||
* Parses URL.
|
||||
*
|
||||
* This parser is charset agnostic. Percent encoded bytes are decoded
|
||||
* for all fields. Returned values might contain things like NUL
|
||||
* characters, spaces, control codes, and non-canonical encodings.
|
||||
* Absent can be discerned from empty by checking if the pointer is set.
|
||||
* for all fields (with the exception of scheme). Returned values might
|
||||
* contain things like NUL characters, spaces, control codes, and
|
||||
* non-canonical encodings. Absent can be discerned from empty by
|
||||
* checking if the pointer is set.
|
||||
*
|
||||
* There's no failure condition for this routine. This is a permissive
|
||||
* parser. This doesn't normalize path segments like `.` or `..` so use
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue