headers.lua 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. -----------------------------------------------------------------------------
  2. -- Canonic header field capitalization
  3. -- LuaSocket toolkit.
  4. -- Author: Diego Nehab
  5. -----------------------------------------------------------------------------
  6. local socket = require("socket")
  7. socket.headers = {}
  8. local _M = socket.headers
  9. _M.canonic = {
  10. ["accept"] = "Accept",
  11. ["accept-charset"] = "Accept-Charset",
  12. ["accept-encoding"] = "Accept-Encoding",
  13. ["accept-language"] = "Accept-Language",
  14. ["accept-ranges"] = "Accept-Ranges",
  15. ["action"] = "Action",
  16. ["alternate-recipient"] = "Alternate-Recipient",
  17. ["age"] = "Age",
  18. ["allow"] = "Allow",
  19. ["arrival-date"] = "Arrival-Date",
  20. ["authorization"] = "Authorization",
  21. ["bcc"] = "Bcc",
  22. ["cache-control"] = "Cache-Control",
  23. ["cc"] = "Cc",
  24. ["comments"] = "Comments",
  25. ["connection"] = "Connection",
  26. ["content-description"] = "Content-Description",
  27. ["content-disposition"] = "Content-Disposition",
  28. ["content-encoding"] = "Content-Encoding",
  29. ["content-id"] = "Content-ID",
  30. ["content-language"] = "Content-Language",
  31. ["content-length"] = "Content-Length",
  32. ["content-location"] = "Content-Location",
  33. ["content-md5"] = "Content-MD5",
  34. ["content-range"] = "Content-Range",
  35. ["content-transfer-encoding"] = "Content-Transfer-Encoding",
  36. ["content-type"] = "Content-Type",
  37. ["cookie"] = "Cookie",
  38. ["date"] = "Date",
  39. ["diagnostic-code"] = "Diagnostic-Code",
  40. ["dsn-gateway"] = "DSN-Gateway",
  41. ["etag"] = "ETag",
  42. ["expect"] = "Expect",
  43. ["expires"] = "Expires",
  44. ["final-log-id"] = "Final-Log-ID",
  45. ["final-recipient"] = "Final-Recipient",
  46. ["from"] = "From",
  47. ["host"] = "Host",
  48. ["if-match"] = "If-Match",
  49. ["if-modified-since"] = "If-Modified-Since",
  50. ["if-none-match"] = "If-None-Match",
  51. ["if-range"] = "If-Range",
  52. ["if-unmodified-since"] = "If-Unmodified-Since",
  53. ["in-reply-to"] = "In-Reply-To",
  54. ["keywords"] = "Keywords",
  55. ["last-attempt-date"] = "Last-Attempt-Date",
  56. ["last-modified"] = "Last-Modified",
  57. ["location"] = "Location",
  58. ["max-forwards"] = "Max-Forwards",
  59. ["message-id"] = "Message-ID",
  60. ["mime-version"] = "MIME-Version",
  61. ["original-envelope-id"] = "Original-Envelope-ID",
  62. ["original-recipient"] = "Original-Recipient",
  63. ["pragma"] = "Pragma",
  64. ["proxy-authenticate"] = "Proxy-Authenticate",
  65. ["proxy-authorization"] = "Proxy-Authorization",
  66. ["range"] = "Range",
  67. ["received"] = "Received",
  68. ["received-from-mta"] = "Received-From-MTA",
  69. ["references"] = "References",
  70. ["referer"] = "Referer",
  71. ["remote-mta"] = "Remote-MTA",
  72. ["reply-to"] = "Reply-To",
  73. ["reporting-mta"] = "Reporting-MTA",
  74. ["resent-bcc"] = "Resent-Bcc",
  75. ["resent-cc"] = "Resent-Cc",
  76. ["resent-date"] = "Resent-Date",
  77. ["resent-from"] = "Resent-From",
  78. ["resent-message-id"] = "Resent-Message-ID",
  79. ["resent-reply-to"] = "Resent-Reply-To",
  80. ["resent-sender"] = "Resent-Sender",
  81. ["resent-to"] = "Resent-To",
  82. ["retry-after"] = "Retry-After",
  83. ["return-path"] = "Return-Path",
  84. ["sender"] = "Sender",
  85. ["server"] = "Server",
  86. ["smtp-remote-recipient"] = "SMTP-Remote-Recipient",
  87. ["status"] = "Status",
  88. ["subject"] = "Subject",
  89. ["te"] = "TE",
  90. ["to"] = "To",
  91. ["trailer"] = "Trailer",
  92. ["transfer-encoding"] = "Transfer-Encoding",
  93. ["upgrade"] = "Upgrade",
  94. ["user-agent"] = "User-Agent",
  95. ["vary"] = "Vary",
  96. ["via"] = "Via",
  97. ["warning"] = "Warning",
  98. ["will-retry-until"] = "Will-Retry-Until",
  99. ["www-authenticate"] = "WWW-Authenticate",
  100. ["x-mailer"] = "X-Mailer",
  101. }
  102. return _M