aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2020-09-20 22:12:19 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2020-09-20 22:12:19 +0300
commit7138f3524c1cf4660c2a990e9cd0ddd10816ea88 (patch)
treec49cc26322b1dc6302a215cef8bd22d83e07c6ea
parente1f5f53a5f57d5be618dc22f1d6d210509fae36a (diff)
downloadlibmicrohttpd-7138f3524c1cf4660c2a990e9cd0ddd10816ea88.tar.gz
libmicrohttpd-7138f3524c1cf4660c2a990e9cd0ddd10816ea88.zip
Updated HTTP headers names, status codes and methods
-rw-r--r--src/include/microhttpd.h20
-rw-r--r--src/microhttpd/reason_phrase.c198
2 files changed, 116 insertions, 102 deletions
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h
index 9a49f67b..ad056c9b 100644
--- a/src/include/microhttpd.h
+++ b/src/include/microhttpd.h
@@ -539,7 +539,7 @@ MHD_get_reason_phrase_for (unsigned int code);
539 * @defgroup headers HTTP headers 539 * @defgroup headers HTTP headers
540 * These are the standard headers found in HTTP requests and responses. 540 * These are the standard headers found in HTTP requests and responses.
541 * See: http://www.iana.org/assignments/message-headers/message-headers.xml 541 * See: http://www.iana.org/assignments/message-headers/message-headers.xml
542 * Registry export date: 2019-06-09 542 * Registry export date: 2020-09-20
543 * @{ 543 * @{
544 */ 544 */
545 545
@@ -646,6 +646,8 @@ MHD_get_reason_phrase_for (unsigned int code);
646#define MHD_HTTP_HEADER_A_IM "A-IM" 646#define MHD_HTTP_HEADER_A_IM "A-IM"
647/* No category. RFC4229 */ 647/* No category. RFC4229 */
648#define MHD_HTTP_HEADER_ACCEPT_ADDITIONS "Accept-Additions" 648#define MHD_HTTP_HEADER_ACCEPT_ADDITIONS "Accept-Additions"
649/* Experimental. RFC-ietf-httpbis-client-hints-15, Section 3.1 */
650#define MHD_HTTP_HEADER_ACCEPT_CH "Accept-CH"
649/* Informational. RFC7089 */ 651/* Informational. RFC7089 */
650#define MHD_HTTP_HEADER_ACCEPT_DATETIME "Accept-Datetime" 652#define MHD_HTTP_HEADER_ACCEPT_DATETIME "Accept-Datetime"
651/* No category. RFC4229 */ 653/* No category. RFC4229 */
@@ -684,6 +686,10 @@ MHD_get_reason_phrase_for (unsigned int code);
684#define MHD_HTTP_HEADER_CALDAV_TIMEZONES "CalDAV-Timezones" 686#define MHD_HTTP_HEADER_CALDAV_TIMEZONES "CalDAV-Timezones"
685/* Standard. RFC8586 */ 687/* Standard. RFC8586 */
686#define MHD_HTTP_HEADER_CDN_LOOP "CDN-Loop" 688#define MHD_HTTP_HEADER_CDN_LOOP "CDN-Loop"
689/* Standard. RFC8739, Section 3.3 */
690#define MHD_HTTP_HEADER_CERT_NOT_AFTER "Cert-Not-After"
691/* Standard. RFC8739, Section 3.3 */
692#define MHD_HTTP_HEADER_CERT_NOT_BEFORE "Cert-Not-Before"
687/* Obsoleted. RFC2068; RFC2616 */ 693/* Obsoleted. RFC2068; RFC2616 */
688#define MHD_HTTP_HEADER_CONTENT_BASE "Content-Base" 694#define MHD_HTTP_HEADER_CONTENT_BASE "Content-Base"
689/* Standard. RFC6266 */ 695/* Standard. RFC6266 */
@@ -759,6 +765,14 @@ MHD_get_reason_phrase_for (unsigned int code);
759#define MHD_HTTP_HEADER_METER "Meter" 765#define MHD_HTTP_HEADER_METER "Meter"
760/* No category. RFC4229 */ 766/* No category. RFC4229 */
761#define MHD_HTTP_HEADER_NEGOTIATE "Negotiate" 767#define MHD_HTTP_HEADER_NEGOTIATE "Negotiate"
768/* Standard. OData Version 4.01 Part 1: Protocol; OASIS; Chet_Ensign */
769#define MHD_HTTP_HEADER_ODATA_ENTITYID "OData-EntityId"
770/* Standard. OData Version 4.01 Part 1: Protocol; OASIS; Chet_Ensign */
771#define MHD_HTTP_HEADER_ODATA_ISOLATION "OData-Isolation"
772/* Standard. OData Version 4.01 Part 1: Protocol; OASIS; Chet_Ensign */
773#define MHD_HTTP_HEADER_ODATA_MAXVERSION "OData-MaxVersion"
774/* Standard. OData Version 4.01 Part 1: Protocol; OASIS; Chet_Ensign */
775#define MHD_HTTP_HEADER_ODATA_VERSION "OData-Version"
762/* No category. RFC4229 */ 776/* No category. RFC4229 */
763#define MHD_HTTP_HEADER_OPT "Opt" 777#define MHD_HTTP_HEADER_OPT "Opt"
764/* Experimental. RFC8053, Section 3 */ 778/* Experimental. RFC8053, Section 3 */
@@ -767,7 +781,7 @@ MHD_get_reason_phrase_for (unsigned int code);
767#define MHD_HTTP_HEADER_ORDERING_TYPE "Ordering-Type" 781#define MHD_HTTP_HEADER_ORDERING_TYPE "Ordering-Type"
768/* Standard. RFC6454 */ 782/* Standard. RFC6454 */
769#define MHD_HTTP_HEADER_ORIGIN "Origin" 783#define MHD_HTTP_HEADER_ORIGIN "Origin"
770/* Standard. RFC-ietf-core-object-security-16, Section 11.1 */ 784/* Standard. RFC8613, Section 11.1 */
771#define MHD_HTTP_HEADER_OSCORE "OSCORE" 785#define MHD_HTTP_HEADER_OSCORE "OSCORE"
772/* Standard. RFC4918 */ 786/* Standard. RFC4918 */
773#define MHD_HTTP_HEADER_OVERWRITE "Overwrite" 787#define MHD_HTTP_HEADER_OVERWRITE "Overwrite"
@@ -893,7 +907,7 @@ MHD_get_reason_phrase_for (unsigned int code);
893 * @defgroup methods HTTP methods 907 * @defgroup methods HTTP methods
894 * HTTP methods (as strings). 908 * HTTP methods (as strings).
895 * See: http://www.iana.org/assignments/http-methods/http-methods.xml 909 * See: http://www.iana.org/assignments/http-methods/http-methods.xml
896 * Registry export date: 2019-06-09 910 * Registry export date: 2020-09-20
897 * @{ 911 * @{
898 */ 912 */
899 913
diff --git a/src/microhttpd/reason_phrase.c b/src/microhttpd/reason_phrase.c
index 7891854a..4e54d920 100644
--- a/src/microhttpd/reason_phrase.c
+++ b/src/microhttpd/reason_phrase.c
@@ -36,121 +36,121 @@ static const char *const invalid_hundred[] = {
36}; 36};
37 37
38static const char *const one_hundred[] = { 38static const char *const one_hundred[] = {
39 /* 100 */ "Continue" /* RFC7231, Section 6.2.1 */, 39 /* 100 */ "Continue", /* RFC7231, Section 6.2.1 */
40 /* 101 */ "Switching Protocols" /* RFC7231, Section 6.2.2 */, 40 /* 101 */ "Switching Protocols", /* RFC7231, Section 6.2.2 */
41 /* 102 */ "Processing" /* RFC2518 */, 41 /* 102 */ "Processing", /* RFC2518 */
42 /* 103 */ "Early Hints" /* RFC8297 */ 42 /* 103 */ "Early Hints" /* RFC8297 */
43}; 43};
44 44
45static const char *const two_hundred[] = { 45static const char *const two_hundred[] = {
46 /* 200 */ "OK" /* RFC7231, Section 6.3.1 */, 46 /* 200 */ "OK", /* RFC7231, Section 6.3.1 */
47 /* 201 */ "Created" /* RFC7231, Section 6.3.2 */, 47 /* 201 */ "Created", /* RFC7231, Section 6.3.2 */
48 /* 202 */ "Accepted" /* RFC7231, Section 6.3.3 */, 48 /* 202 */ "Accepted", /* RFC7231, Section 6.3.3 */
49 /* 203 */ "Non-Authoritative Information" /* RFC7231, Section 6.3.4 */, 49 /* 203 */ "Non-Authoritative Information", /* RFC7231, Section 6.3.4 */
50 /* 204 */ "No Content" /* RFC7231, Section 6.3.5 */, 50 /* 204 */ "No Content", /* RFC7231, Section 6.3.5 */
51 /* 205 */ "Reset Content" /* RFC7231, Section 6.3.6 */, 51 /* 205 */ "Reset Content", /* RFC7231, Section 6.3.6 */
52 /* 206 */ "Partial Content" /* RFC7233, Section 4.1 */, 52 /* 206 */ "Partial Content", /* RFC7233, Section 4.1 */
53 /* 207 */ "Multi-Status" /* RFC4918 */, 53 /* 207 */ "Multi-Status", /* RFC4918 */
54 /* 208 */ "Already Reported" /* RFC5842 */, 54 /* 208 */ "Already Reported", /* RFC5842 */
55 /* 209 */ "Unknown" /* Not used */, 55 /* 209 */ "Unknown", /* Not used */
56 /* 210 */ "Unknown" /* Not used */, 56 /* 210 */ "Unknown", /* Not used */
57 /* 211 */ "Unknown" /* Not used */, 57 /* 211 */ "Unknown", /* Not used */
58 /* 212 */ "Unknown" /* Not used */, 58 /* 212 */ "Unknown", /* Not used */
59 /* 213 */ "Unknown" /* Not used */, 59 /* 213 */ "Unknown", /* Not used */
60 /* 214 */ "Unknown" /* Not used */, 60 /* 214 */ "Unknown", /* Not used */
61 /* 215 */ "Unknown" /* Not used */, 61 /* 215 */ "Unknown", /* Not used */
62 /* 216 */ "Unknown" /* Not used */, 62 /* 216 */ "Unknown", /* Not used */
63 /* 217 */ "Unknown" /* Not used */, 63 /* 217 */ "Unknown", /* Not used */
64 /* 218 */ "Unknown" /* Not used */, 64 /* 218 */ "Unknown", /* Not used */
65 /* 219 */ "Unknown" /* Not used */, 65 /* 219 */ "Unknown", /* Not used */
66 /* 220 */ "Unknown" /* Not used */, 66 /* 220 */ "Unknown", /* Not used */
67 /* 221 */ "Unknown" /* Not used */, 67 /* 221 */ "Unknown", /* Not used */
68 /* 222 */ "Unknown" /* Not used */, 68 /* 222 */ "Unknown", /* Not used */
69 /* 223 */ "Unknown" /* Not used */, 69 /* 223 */ "Unknown", /* Not used */
70 /* 224 */ "Unknown" /* Not used */, 70 /* 224 */ "Unknown", /* Not used */
71 /* 225 */ "Unknown" /* Not used */, 71 /* 225 */ "Unknown", /* Not used */
72 /* 226 */ "IM Used" /* RFC3229 */ 72 /* 226 */ "IM Used" /* RFC3229 */
73}; 73};
74 74
75static const char *const three_hundred[] = { 75static const char *const three_hundred[] = {
76 /* 300 */ "Multiple Choices" /* RFC7231, Section 6.4.1 */, 76 /* 300 */ "Multiple Choices", /* RFC7231, Section 6.4.1 */
77 /* 301 */ "Moved Permanently" /* RFC7231, Section 6.4.2 */, 77 /* 301 */ "Moved Permanently", /* RFC7231, Section 6.4.2 */
78 /* 302 */ "Found" /* RFC7231, Section 6.4.3 */, 78 /* 302 */ "Found", /* RFC7231, Section 6.4.3 */
79 /* 303 */ "See Other" /* RFC7231, Section 6.4.4 */, 79 /* 303 */ "See Other", /* RFC7231, Section 6.4.4 */
80 /* 304 */ "Not Modified" /* RFC7232, Section 4.1 */, 80 /* 304 */ "Not Modified", /* RFC7232, Section 4.1 */
81 /* 305 */ "Use Proxy" /* RFC7231, Section 6.4.5 */, 81 /* 305 */ "Use Proxy", /* RFC7231, Section 6.4.5 */
82 /* 306 */ "Switch Proxy" /* Not used! RFC7231, Section 6.4.6 */, 82 /* 306 */ "Switch Proxy", /* Not used! RFC7231, Section 6.4.6 */
83 /* 307 */ "Temporary Redirect" /* RFC7231, Section 6.4.7 */, 83 /* 307 */ "Temporary Redirect", /* RFC7231, Section 6.4.7 */
84 /* 308 */ "Permanent Redirect" /* RFC7538 */ 84 /* 308 */ "Permanent Redirect" /* RFC7538 */
85}; 85};
86 86
87static const char *const four_hundred[] = { 87static const char *const four_hundred[] = {
88 /* 400 */ "Bad Request" /* RFC7231, Section 6.5.1 */, 88 /* 400 */ "Bad Request", /* RFC7231, Section 6.5.1 */
89 /* 401 */ "Unauthorized" /* RFC7235, Section 3.1 */, 89 /* 401 */ "Unauthorized", /* RFC7235, Section 3.1 */
90 /* 402 */ "Payment Required" /* RFC7231, Section 6.5.2 */, 90 /* 402 */ "Payment Required", /* RFC7231, Section 6.5.2 */
91 /* 403 */ "Forbidden" /* RFC7231, Section 6.5.3 */, 91 /* 403 */ "Forbidden", /* RFC7231, Section 6.5.3 */
92 /* 404 */ "Not Found" /* RFC7231, Section 6.5.4 */, 92 /* 404 */ "Not Found", /* RFC7231, Section 6.5.4 */
93 /* 405 */ "Method Not Allowed" /* RFC7231, Section 6.5.5 */, 93 /* 405 */ "Method Not Allowed", /* RFC7231, Section 6.5.5 */
94 /* 406 */ "Not Acceptable" /* RFC7231, Section 6.5.6 */, 94 /* 406 */ "Not Acceptable", /* RFC7231, Section 6.5.6 */
95 /* 407 */ "Proxy Authentication Required" /* RFC7235, Section 3.2 */, 95 /* 407 */ "Proxy Authentication Required", /* RFC7235, Section 3.2 */
96 /* 408 */ "Request Timeout" /* RFC7231, Section 6.5.7 */, 96 /* 408 */ "Request Timeout", /* RFC7231, Section 6.5.7 */
97 /* 409 */ "Conflict" /* RFC7231, Section 6.5.8 */, 97 /* 409 */ "Conflict", /* RFC7231, Section 6.5.8 */
98 /* 410 */ "Gone" /* RFC7231, Section 6.5.9 */, 98 /* 410 */ "Gone", /* RFC7231, Section 6.5.9 */
99 /* 411 */ "Length Required" /* RFC7231, Section 6.5.10 */, 99 /* 411 */ "Length Required", /* RFC7231, Section 6.5.10 */
100 /* 412 */ "Precondition Failed" /* RFC7232, Section 4.2; RFC8144, Section 3.2 */, 100 /* 412 */ "Precondition Failed", /* RFC7232, Section 4.2; RFC8144, Section 3.2 */
101 /* 413 */ "Payload Too Large" /* RFC7231, Section 6.5.11 */, 101 /* 413 */ "Payload Too Large", /* RFC7231, Section 6.5.11 */
102 /* 414 */ "URI Too Long" /* RFC7231, Section 6.5.12 */, 102 /* 414 */ "URI Too Long", /* RFC7231, Section 6.5.12 */
103 /* 415 */ "Unsupported Media Type" /* RFC7231, Section 6.5.13; RFC7694, Section 3 */, 103 /* 415 */ "Unsupported Media Type", /* RFC7231, Section 6.5.13; RFC7694, Section 3 */
104 /* 416 */ "Range Not Satisfiable" /* RFC7233, Section 4.4 */, 104 /* 416 */ "Range Not Satisfiable", /* RFC7233, Section 4.4 */
105 /* 417 */ "Expectation Failed" /* RFC7231, Section 6.5.14 */, 105 /* 417 */ "Expectation Failed", /* RFC7231, Section 6.5.14 */
106 /* 418 */ "Unknown" /* Not used */, 106 /* 418 */ "Unknown", /* Not used */
107 /* 419 */ "Unknown" /* Not used */, 107 /* 419 */ "Unknown", /* Not used */
108 /* 420 */ "Unknown" /* Not used */, 108 /* 420 */ "Unknown", /* Not used */
109 /* 421 */ "Misdirected Request" /* RFC7540, Section 9.1.2 */, 109 /* 421 */ "Misdirected Request", /* RFC7540, Section 9.1.2 */
110 /* 422 */ "Unprocessable Entity" /* RFC4918 */, 110 /* 422 */ "Unprocessable Entity", /* RFC4918 */
111 /* 423 */ "Locked" /* RFC4918 */, 111 /* 423 */ "Locked", /* RFC4918 */
112 /* 424 */ "Failed Dependency" /* RFC4918 */, 112 /* 424 */ "Failed Dependency", /* RFC4918 */
113 /* 425 */ "Too Early" /* RFC8470 */, 113 /* 425 */ "Too Early", /* RFC8470 */
114 /* 426 */ "Upgrade Required" /* RFC7231, Section 6.5.15 */, 114 /* 426 */ "Upgrade Required", /* RFC7231, Section 6.5.15 */
115 /* 427 */ "Unknown" /* Not used */, 115 /* 427 */ "Unknown", /* Not used */
116 /* 428 */ "Precondition Required" /* RFC6585 */, 116 /* 428 */ "Precondition Required", /* RFC6585 */
117 /* 429 */ "Too Many Requests" /* RFC6585 */, 117 /* 429 */ "Too Many Requests", /* RFC6585 */
118 /* 430 */ "Unknown" /* Not used */, 118 /* 430 */ "Unknown", /* Not used */
119 /* 431 */ "Request Header Fields Too Large" /* RFC6585 */, 119 /* 431 */ "Request Header Fields Too Large", /* RFC6585 */
120 /* 432 */ "Unknown" /* Not used */, 120 /* 432 */ "Unknown", /* Not used */
121 /* 433 */ "Unknown" /* Not used */, 121 /* 433 */ "Unknown", /* Not used */
122 /* 434 */ "Unknown" /* Not used */, 122 /* 434 */ "Unknown", /* Not used */
123 /* 435 */ "Unknown" /* Not used */, 123 /* 435 */ "Unknown", /* Not used */
124 /* 436 */ "Unknown" /* Not used */, 124 /* 436 */ "Unknown", /* Not used */
125 /* 437 */ "Unknown" /* Not used */, 125 /* 437 */ "Unknown", /* Not used */
126 /* 438 */ "Unknown" /* Not used */, 126 /* 438 */ "Unknown", /* Not used */
127 /* 439 */ "Unknown" /* Not used */, 127 /* 439 */ "Unknown", /* Not used */
128 /* 440 */ "Unknown" /* Not used */, 128 /* 440 */ "Unknown", /* Not used */
129 /* 441 */ "Unknown" /* Not used */, 129 /* 441 */ "Unknown", /* Not used */
130 /* 442 */ "Unknown" /* Not used */, 130 /* 442 */ "Unknown", /* Not used */
131 /* 443 */ "Unknown" /* Not used */, 131 /* 443 */ "Unknown", /* Not used */
132 /* 444 */ "Unknown" /* Not used */, 132 /* 444 */ "Unknown", /* Not used */
133 /* 445 */ "Unknown" /* Not used */, 133 /* 445 */ "Unknown", /* Not used */
134 /* 446 */ "Unknown" /* Not used */, 134 /* 446 */ "Unknown", /* Not used */
135 /* 447 */ "Unknown" /* Not used */, 135 /* 447 */ "Unknown", /* Not used */
136 /* 448 */ "Unknown" /* Not used */, 136 /* 448 */ "Unknown", /* Not used */
137 /* 449 */ "Reply With" /* MS IIS extension */, 137 /* 449 */ "Reply With", /* MS IIS extension */
138 /* 450 */ "Blocked by Windows Parental Controls" /* MS extension */, 138 /* 450 */ "Blocked by Windows Parental Controls", /* MS extension */
139 /* 451 */ "Unavailable For Legal Reasons" /* RFC7725 */ 139 /* 451 */ "Unavailable For Legal Reasons" /* RFC7725 */
140}; 140};
141 141
142static const char *const five_hundred[] = { 142static const char *const five_hundred[] = {
143 /* 500 */ "Internal Server Error" /* RFC7231, Section 6.6.1 */, 143 /* 500 */ "Internal Server Error", /* RFC7231, Section 6.6.1 */
144 /* 501 */ "Not Implemented" /* RFC7231, Section 6.6.2 */, 144 /* 501 */ "Not Implemented", /* RFC7231, Section 6.6.2 */
145 /* 502 */ "Bad Gateway" /* RFC7231, Section 6.6.3 */, 145 /* 502 */ "Bad Gateway", /* RFC7231, Section 6.6.3 */
146 /* 503 */ "Service Unavailable" /* RFC7231, Section 6.6.4 */, 146 /* 503 */ "Service Unavailable", /* RFC7231, Section 6.6.4 */
147 /* 504 */ "Gateway Timeout" /* RFC7231, Section 6.6.5 */, 147 /* 504 */ "Gateway Timeout", /* RFC7231, Section 6.6.5 */
148 /* 505 */ "HTTP Version Not Supported" /* RFC7231, Section 6.6.6 */, 148 /* 505 */ "HTTP Version Not Supported", /* RFC7231, Section 6.6.6 */
149 /* 506 */ "Variant Also Negotiates" /* RFC2295 */, 149 /* 506 */ "Variant Also Negotiates", /* RFC2295 */
150 /* 507 */ "Insufficient Storage" /* RFC4918 */, 150 /* 507 */ "Insufficient Storage", /* RFC4918 */
151 /* 508 */ "Loop Detected" /* RFC5842 */, 151 /* 508 */ "Loop Detected", /* RFC5842 */
152 /* 509 */ "Bandwidth Limit Exceeded" /* Apache extension */, 152 /* 509 */ "Bandwidth Limit Exceeded", /* Apache extension */
153 /* 510 */ "Not Extended" /* RFC2774 */, 153 /* 510 */ "Not Extended", /* RFC2774 */
154 /* 511 */ "Network Authentication Required" /* RFC6585 */ 154 /* 511 */ "Network Authentication Required" /* RFC6585 */
155}; 155};
156 156