header.go 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package ajp13
  2. // HTTPHeader encodes which HTTP header is being used
  3. type HTTPHeader uint16
  4. const (
  5. Accept = HTTPHeader(iota + 0xA001)
  6. AcceptCharset = HTTPHeader(iota + 0xA001)
  7. AcceptEncoding = HTTPHeader(iota + 0xA001)
  8. AcceptLanguage = HTTPHeader(iota + 0xA001)
  9. Authorization = HTTPHeader(iota + 0xA001)
  10. Connection = HTTPHeader(iota + 0xA001)
  11. ContentType = HTTPHeader(iota + 0xA001)
  12. ContentLength = HTTPHeader(iota + 0xA001)
  13. Cookie = HTTPHeader(iota + 0xA001)
  14. Cookie2 = HTTPHeader(iota + 0xA001)
  15. Host = HTTPHeader(iota + 0xA001)
  16. Pragma = HTTPHeader(iota + 0xA001)
  17. Referer = HTTPHeader(iota + 0xA001)
  18. UserAgent = HTTPHeader(iota + 0xA001)
  19. )
  20. func (h HTTPHeader) String() string {
  21. switch h {
  22. case Accept:
  23. return "Accept"
  24. case AcceptCharset:
  25. return "Accept-Charset"
  26. case AcceptEncoding:
  27. return "Accept-Encoding"
  28. case AcceptLanguage:
  29. return "Accept-Language"
  30. case Authorization:
  31. return "Authorization"
  32. case Connection:
  33. return "Connection"
  34. case ContentType:
  35. return "Content-Type"
  36. case ContentLength:
  37. return "Content-Length"
  38. case Cookie:
  39. return "Cookie"
  40. case Cookie2:
  41. return "Cookie2"
  42. case Host:
  43. return "Host"
  44. case Pragma:
  45. return "Pragma"
  46. case Referer:
  47. return "Referer"
  48. case UserAgent:
  49. return "User-Agent"
  50. }
  51. return "UNKNOWN"
  52. }