HttpRequestHeaderEnumToName.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. //Copyright 2010 Microsoft Corporation
  2. //
  3. //Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
  4. //You may obtain a copy of the License at
  5. //
  6. //http://www.apache.org/licenses/LICENSE-2.0
  7. //
  8. //Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an
  9. //"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. //See the License for the specific language governing permissions and limitations under the License.
  11. namespace System.Data.Services.Http
  12. {
  13. internal class HttpRequestHeaderEnumToName
  14. {
  15. private static readonly string[] HeaderStrings = new string[]
  16. {
  17. "Cache-Control",
  18. "Connection",
  19. "Date",
  20. "Keep-Alive",
  21. "Pragma",
  22. "Trailer",
  23. "Transfer-Encoding",
  24. "Upgrade",
  25. "Via",
  26. "Warning",
  27. "Allow",
  28. "Content-Length",
  29. "Content-Type",
  30. "Content-Encoding",
  31. "Content-Language",
  32. "Content-Location",
  33. "Content-MD5",
  34. "Content-Range",
  35. "Expires",
  36. "Last-Modified",
  37. "Accept",
  38. "Accept-Charset",
  39. "Accept-Encoding",
  40. "Accept-Language",
  41. "Authorization",
  42. "Cookie",
  43. "Expect",
  44. "From",
  45. "Host",
  46. "If-Match",
  47. "If-Modified-Since",
  48. "If-None-Match",
  49. "If-Range",
  50. "If-Unmodified-Since",
  51. "Max-Forwards",
  52. "Proxy-Authorization",
  53. "Referer",
  54. "Range",
  55. "TE",
  56. "translate",
  57. "UserAgent",
  58. "Wlc-Safe-Agent",
  59. "Slug",
  60. };
  61. public string this[System.Data.Services.Http.HttpRequestHeader header]
  62. {
  63. get
  64. {
  65. return HeaderStrings[(int)header];
  66. }
  67. }
  68. }
  69. }