@@ -26,7 +26,7 @@ typedef struct _cache {
2626struct _cache key_cache ;
2727
2828// The rack spec indicates the characters (),/:;<=>?@[]{} are invalid which
29- // clearly is not consisten with RFC7230 so stick with the RFC.
29+ // clearly is not consistent with RFC7230 so stick with the RFC.
3030static char header_value_chars [256 ] = "\
3131xxxxxxxxxxoxxxxxxxxxxxxxxxxxxxxx\
3232oooooooooooooooooooooooooooooooo\
@@ -50,7 +50,6 @@ static const char *header_keys[] = {
5050 "Accept-Encoding" ,
5151 "Accept-Features" ,
5252 "Accept-Language" ,
53- "Accept-Language" ,
5453 "Accept-Patch" ,
5554 "Accept-Post" ,
5655 "Accept-Ranges" ,
@@ -74,7 +73,6 @@ static const char *header_keys[] = {
7473 "Approved" ,
7574 "Archive" ,
7675 "Archived-At" ,
77- "Archived-At" ,
7876 "Article-Names" ,
7977 "Article-Updates" ,
8078 "Authentication-Control" ,
@@ -99,36 +97,27 @@ static const char *header_keys[] = {
9997 "Cc" ,
10098 "Close" ,
10199 "Comments" ,
102- "Comments" ,
103100 "Compliance" ,
104101 "Connection" ,
105102 "Content-Alternative" ,
106103 "Content-Base" ,
107- "Content-Base" ,
108104 "Content-Description" ,
109105 "Content-Disposition" ,
110- "Content-Disposition" ,
111106 "Content-Duration" ,
112107 "Content-Encoding" ,
113108 "Content-ID" ,
114- "Content-ID" ,
115109 "Content-Identifier" ,
116110 "Content-Language" ,
117- "Content-Language" ,
118111 "Content-Length" ,
119112 "Content-Location" ,
120- "Content-Location" ,
121- "Content-MD5" ,
122113 "Content-MD5" ,
123114 "Content-Range" ,
124115 "Content-Return" ,
125116 "Content-Script-Type" ,
126117 "Content-Style-Type" ,
127118 "Content-Transfer-Encoding" ,
128- "Content-Transfer-Encoding" ,
129119 "Content-Translation-Type" ,
130120 "Content-Type" ,
131- "Content-Type" ,
132121 "Content-Version" ,
133122 "Content-features" ,
134123 "Control" ,
@@ -141,8 +130,7 @@ static const char *header_keys[] = {
141130 "DAV" ,
142131 "DKIM-Signature" ,
143132 "DL-Expansion-History" ,
144- "Date" ,
145- "Date" ,
133+ "DNT" ,
146134 "Date" ,
147135 "Date-Received" ,
148136 "Default-Style" ,
@@ -182,24 +170,20 @@ static const char *header_keys[] = {
182170 "Downgraded-Sender" ,
183171 "Downgraded-To" ,
184172 "EDIINT-Features" ,
185- "EDIINT-Features" ,
186173 "ETag" ,
187174 "Eesst-Version" ,
188175 "Encoding" ,
189176 "Encrypted" ,
190177 "Errors-To" ,
191178 "Expect" ,
192179 "Expires" ,
193- "Expires" ,
194- "Expires" ,
195180 "Expiry-Date" ,
196181 "Ext" ,
197182 "Followup-To" ,
198183 "Form-Sub" ,
199184 "Forwarded" ,
200185 "From" ,
201- "From" ,
202- "From" ,
186+ "Front-End-Https" ,
203187 "Generate-Delivery-Report" ,
204188 "GetProfile" ,
205189 "HTTP2-Settings" ,
@@ -219,10 +203,8 @@ static const char *header_keys[] = {
219203 "Injection-Date" ,
220204 "Injection-Info" ,
221205 "Jabber-ID" ,
222- "Jabber-ID" ,
223206 "Keep-Alive" ,
224207 "Keywords" ,
225- "Keywords" ,
226208 "Label" ,
227209 "Language" ,
228210 "Last-Modified" ,
@@ -240,7 +222,6 @@ static const char *header_keys[] = {
240222 "Location" ,
241223 "Lock-Token" ,
242224 "MIME-Version" ,
243- "MIME-Version" ,
244225 "MMHS-Acp127-Message-Identifier" ,
245226 "MMHS-Authorizing-Users" ,
246227 "MMHS-Codress-Message-Indicator" ,
@@ -262,8 +243,6 @@ static const char *header_keys[] = {
262243 "Memento-Datetime" ,
263244 "Message-Context" ,
264245 "Message-ID" ,
265- "Message-ID" ,
266- "Message-ID" ,
267246 "Message-Type" ,
268247 "Meter" ,
269248 "Method-Check" ,
@@ -279,7 +258,6 @@ static const char *header_keys[] = {
279258 "Optional-WWW-Authenticate" ,
280259 "Ordering-Type" ,
281260 "Organization" ,
282- "Organization" ,
283261 "Origin" ,
284262 "Original-Encoded-Information-Types" ,
285263 "Original-From" ,
@@ -292,7 +270,6 @@ static const char *header_keys[] = {
292270 "P3P" ,
293271 "PEP" ,
294272 "PICS-Label" ,
295- "PICS-Label" ,
296273 "Path" ,
297274 "Pep-Info" ,
298275 "Position" ,
@@ -311,6 +288,7 @@ static const char *header_keys[] = {
311288 "Proxy-Authenticate" ,
312289 "Proxy-Authentication-Info" ,
313290 "Proxy-Authorization" ,
291+ "Proxy-Connection" ,
314292 "Proxy-Features" ,
315293 "Proxy-Instruction" ,
316294 "Public" ,
@@ -321,13 +299,11 @@ static const char *header_keys[] = {
321299 "Received-SPF" ,
322300 "Redirect-Ref" ,
323301 "References" ,
324- "References" ,
325302 "Referer" ,
326303 "Referer-Root" ,
327304 "Relay-Version" ,
328305 "Reply-By" ,
329306 "Reply-To" ,
330- "Reply-To" ,
331307 "Require-Recipient-Valid-Since" ,
332308 "Resent-Bcc" ,
333309 "Resent-Cc" ,
@@ -345,6 +321,7 @@ static const char *header_keys[] = {
345321 "SIO-Label-History" ,
346322 "SLUG" ,
347323 "Safe" ,
324+ "Save-Data" ,
348325 "Schedule-Reply" ,
349326 "Schedule-Tag" ,
350327 "Sec-WebSocket-Accept" ,
@@ -367,11 +344,9 @@ static const char *header_keys[] = {
367344 "Strict-Transport-Security" ,
368345 "SubOK" ,
369346 "Subject" ,
370- "Subject" ,
371347 "Subst" ,
372348 "Summary" ,
373349 "Supersedes" ,
374- "Supersedes" ,
375350 "Surrogate-Capability" ,
376351 "Surrogate-Control" ,
377352 "TCN" ,
@@ -390,9 +365,9 @@ static const char *header_keys[] = {
390365 "UA-Windowpixels" ,
391366 "URI" ,
392367 "Upgrade" ,
368+ "Upgrade-Insecure-Requests" ,
393369 "Urgency" ,
394370 "User-Agent" ,
395- "User-Agent" ,
396371 "VBR-Info" ,
397372 "Variant-Vary" ,
398373 "Vary" ,
@@ -401,22 +376,32 @@ static const char *header_keys[] = {
401376 "WWW-Authenticate" ,
402377 "Want-Digest" ,
403378 "Warning" ,
404- "X-Archived-At " ,
379+ "X-ATT-DeviceId " ,
405380 "X-Archived-At" ,
406381 "X-Content-Type-Options" ,
382+ "X-Correlation-ID" ,
383+ "X-Csrf-Token" ,
407384 "X-Device-Accept" ,
408385 "X-Device-Accept-Charset" ,
409386 "X-Device-Accept-Encoding" ,
410387 "X-Device-Accept-Language" ,
411388 "X-Device-User-Agent" ,
389+ "X-Forwarded-For" ,
390+ "X-Forwarded-Host" ,
391+ "X-Forwarded-Proto" ,
412392 "X-Frame-Options" ,
393+ "X-Http-Method-Override" ,
413394 "X-Mittente" ,
414395 "X-PGP-Sig" ,
396+ "X-Request-ID" ,
397+ "X-Requested-With" ,
415398 "X-Ricevuta" ,
416399 "X-Riferimento-Message-ID" ,
417400 "X-TipoRicevuta" ,
418401 "X-Trasporto" ,
402+ "X-UIDH" ,
419403 "X-VerificaSicurezza" ,
404+ "X-Wap-Profile" ,
420405 "X-XSS-Protection" ,
421406 "X400-Content-Identifier" ,
422407 "X400-Content-Return" ,
@@ -469,7 +454,7 @@ key_set(const char *key) {
469454 int64_t h = calc_hash (key , & len );
470455 Slot * bucket = get_bucketp (h );
471456 Slot s ;
472-
457+
473458 if (NULL != (s = (Slot )AGOO_MALLOC (sizeof (struct _slot )))) {
474459 s -> hash = h ;
475460 s -> klen = len ;
@@ -482,7 +467,7 @@ key_set(const char *key) {
482467void
483468agoo_http_init () {
484469 const char * * kp = header_keys ;
485-
470+
486471 memset (& key_cache , 0 , sizeof (struct _cache ));
487472 for (; NULL != * kp ; kp ++ ) {
488473 key_set (* kp );
@@ -550,7 +535,7 @@ agoo_http_header_ok(agooErr err, const char *key, int klen, const char *value, i
550535const char *
551536agoo_http_code_message (int code ) {
552537 const char * msg = "" ;
553-
538+
554539 switch (code ) {
555540 case 100 : msg = "Continue" ; break ;
556541 case 101 : msg = "Switching Protocols" ; break ;
0 commit comments