hdrs.py 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. """HTTP Headers constants."""
  2. # After changing the file content call ./tools/gen.py
  3. # to regenerate the headers parser
  4. from multidict import istr
  5. METH_ANY = "*"
  6. METH_CONNECT = "CONNECT"
  7. METH_HEAD = "HEAD"
  8. METH_GET = "GET"
  9. METH_DELETE = "DELETE"
  10. METH_OPTIONS = "OPTIONS"
  11. METH_PATCH = "PATCH"
  12. METH_POST = "POST"
  13. METH_PUT = "PUT"
  14. METH_TRACE = "TRACE"
  15. METH_ALL = {
  16. METH_CONNECT,
  17. METH_HEAD,
  18. METH_GET,
  19. METH_DELETE,
  20. METH_OPTIONS,
  21. METH_PATCH,
  22. METH_POST,
  23. METH_PUT,
  24. METH_TRACE,
  25. }
  26. ACCEPT = istr("Accept")
  27. ACCEPT_CHARSET = istr("Accept-Charset")
  28. ACCEPT_ENCODING = istr("Accept-Encoding")
  29. ACCEPT_LANGUAGE = istr("Accept-Language")
  30. ACCEPT_RANGES = istr("Accept-Ranges")
  31. ACCESS_CONTROL_MAX_AGE = istr("Access-Control-Max-Age")
  32. ACCESS_CONTROL_ALLOW_CREDENTIALS = istr("Access-Control-Allow-Credentials")
  33. ACCESS_CONTROL_ALLOW_HEADERS = istr("Access-Control-Allow-Headers")
  34. ACCESS_CONTROL_ALLOW_METHODS = istr("Access-Control-Allow-Methods")
  35. ACCESS_CONTROL_ALLOW_ORIGIN = istr("Access-Control-Allow-Origin")
  36. ACCESS_CONTROL_EXPOSE_HEADERS = istr("Access-Control-Expose-Headers")
  37. ACCESS_CONTROL_REQUEST_HEADERS = istr("Access-Control-Request-Headers")
  38. ACCESS_CONTROL_REQUEST_METHOD = istr("Access-Control-Request-Method")
  39. AGE = istr("Age")
  40. ALLOW = istr("Allow")
  41. AUTHORIZATION = istr("Authorization")
  42. CACHE_CONTROL = istr("Cache-Control")
  43. CONNECTION = istr("Connection")
  44. CONTENT_DISPOSITION = istr("Content-Disposition")
  45. CONTENT_ENCODING = istr("Content-Encoding")
  46. CONTENT_LANGUAGE = istr("Content-Language")
  47. CONTENT_LENGTH = istr("Content-Length")
  48. CONTENT_LOCATION = istr("Content-Location")
  49. CONTENT_MD5 = istr("Content-MD5")
  50. CONTENT_RANGE = istr("Content-Range")
  51. CONTENT_TRANSFER_ENCODING = istr("Content-Transfer-Encoding")
  52. CONTENT_TYPE = istr("Content-Type")
  53. COOKIE = istr("Cookie")
  54. DATE = istr("Date")
  55. DESTINATION = istr("Destination")
  56. DIGEST = istr("Digest")
  57. ETAG = istr("Etag")
  58. EXPECT = istr("Expect")
  59. EXPIRES = istr("Expires")
  60. FORWARDED = istr("Forwarded")
  61. FROM = istr("From")
  62. HOST = istr("Host")
  63. IF_MATCH = istr("If-Match")
  64. IF_MODIFIED_SINCE = istr("If-Modified-Since")
  65. IF_NONE_MATCH = istr("If-None-Match")
  66. IF_RANGE = istr("If-Range")
  67. IF_UNMODIFIED_SINCE = istr("If-Unmodified-Since")
  68. KEEP_ALIVE = istr("Keep-Alive")
  69. LAST_EVENT_ID = istr("Last-Event-ID")
  70. LAST_MODIFIED = istr("Last-Modified")
  71. LINK = istr("Link")
  72. LOCATION = istr("Location")
  73. MAX_FORWARDS = istr("Max-Forwards")
  74. ORIGIN = istr("Origin")
  75. PRAGMA = istr("Pragma")
  76. PROXY_AUTHENTICATE = istr("Proxy-Authenticate")
  77. PROXY_AUTHORIZATION = istr("Proxy-Authorization")
  78. RANGE = istr("Range")
  79. REFERER = istr("Referer")
  80. RETRY_AFTER = istr("Retry-After")
  81. SEC_WEBSOCKET_ACCEPT = istr("Sec-WebSocket-Accept")
  82. SEC_WEBSOCKET_VERSION = istr("Sec-WebSocket-Version")
  83. SEC_WEBSOCKET_PROTOCOL = istr("Sec-WebSocket-Protocol")
  84. SEC_WEBSOCKET_EXTENSIONS = istr("Sec-WebSocket-Extensions")
  85. SEC_WEBSOCKET_KEY = istr("Sec-WebSocket-Key")
  86. SEC_WEBSOCKET_KEY1 = istr("Sec-WebSocket-Key1")
  87. SERVER = istr("Server")
  88. SET_COOKIE = istr("Set-Cookie")
  89. TE = istr("TE")
  90. TRAILER = istr("Trailer")
  91. TRANSFER_ENCODING = istr("Transfer-Encoding")
  92. UPGRADE = istr("Upgrade")
  93. URI = istr("URI")
  94. USER_AGENT = istr("User-Agent")
  95. VARY = istr("Vary")
  96. VIA = istr("Via")
  97. WANT_DIGEST = istr("Want-Digest")
  98. WARNING = istr("Warning")
  99. WWW_AUTHENTICATE = istr("WWW-Authenticate")
  100. X_FORWARDED_FOR = istr("X-Forwarded-For")
  101. X_FORWARDED_HOST = istr("X-Forwarded-Host")
  102. X_FORWARDED_PROTO = istr("X-Forwarded-Proto")