accept.txt 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. # Accept: [Accept: header value from RFC2616,
  2. # http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html]
  3. # Available: [whitespace-separated content types]
  4. # Expected: [Accept-header like list, containing the available content
  5. # types with their q-values]
  6. Accept: */*
  7. Available: text/plain
  8. Expected: text/plain; q=1.0
  9. Accept: */*
  10. Available: text/plain, text/html
  11. Expected: text/plain; q=1.0, text/html; q=1.0
  12. # The order matters
  13. Accept: */*
  14. Available: text/html, text/plain
  15. Expected: text/html; q=1.0, text/plain; q=1.0
  16. Accept: text/*, */*; q=0.9
  17. Available: text/plain, image/jpeg
  18. Expected: text/plain; q=1.0, image/jpeg; q=0.9
  19. Accept: text/*, */*; q=0.9
  20. Available: image/jpeg, text/plain
  21. Expected: text/plain; q=1.0, image/jpeg; q=0.9
  22. # wildcard subtypes still reject differing main types
  23. Accept: text/*
  24. Available: image/jpeg, text/plain
  25. Expected: text/plain; q=1.0
  26. Accept: text/html
  27. Available: text/html
  28. Expected: text/html; q=1.0
  29. Accept: text/html, text/*
  30. Available: text/html
  31. Expected: text/html; q=1.0
  32. Accept: text/html, text/*
  33. Available: text/plain, text/html
  34. Expected: text/plain; q=1.0, text/html; q=1.0
  35. Accept: text/html, text/*; q=0.9
  36. Available: text/plain, text/html
  37. Expected: text/html; q=1.0, text/plain; q=0.9
  38. # If a more specific type has a higher q-value, then the higher value wins
  39. Accept: text/*; q=0.9, text/html
  40. Available: text/plain, text/html
  41. Expected: text/html; q=1.0, text/plain; q=0.9
  42. Accept: */*, text/*; q=0.9, text/html; q=0.1
  43. Available: text/plain, text/html, image/monkeys
  44. Expected: image/monkeys; q=1.0, text/plain; q=0.9, text/html; q=0.1
  45. Accept: text/*, text/html; q=0
  46. Available: text/html
  47. Expected:
  48. Accept: text/*, text/html; q=0
  49. Available: text/html, text/plain
  50. Expected: text/plain; q=1.0
  51. Accept: text/html
  52. Available: text/plain
  53. Expected:
  54. Accept: application/xrds+xml, text/html; q=0.9
  55. Available: application/xrds+xml, text/html
  56. Expected: application/xrds+xml; q=1.0, text/html; q=0.9
  57. Accept: application/xrds+xml, */*; q=0.9
  58. Available: application/xrds+xml, text/html
  59. Expected: application/xrds+xml; q=1.0, text/html; q=0.9
  60. Accept: application/xrds+xml, application/xhtml+xml; q=0.9, text/html; q=0.8, text/xml; q=0.7
  61. Available: application/xrds+xml, text/html
  62. Expected: application/xrds+xml; q=1.0, text/html; q=0.8
  63. # See http://www.rfc-editor.org/rfc/rfc3023.txt, section A.13
  64. Accept: application/xrds
  65. Available: application/xrds+xml
  66. Expected:
  67. Accept: application/xrds+xml
  68. Available: application/xrds
  69. Expected:
  70. Accept: application/xml
  71. Available: application/xrds+xml
  72. Expected:
  73. Available: application/xrds+xml
  74. Accept: application/xml
  75. Expected:
  76. #################################################
  77. # The tests below this line are documentation of how this library
  78. # works. If the implementation changes, it's acceptable to change the
  79. # test to reflect that. These are specified so that we can make sure
  80. # that the current implementation actually works the way that we
  81. # expect it to given these inputs.
  82. Accept: text/html;level=1
  83. Available: text/html
  84. Expected: text/html; q=1.0
  85. Accept: text/html; level=1, text/html; level=9; q=0.1
  86. Available: text/html
  87. Expected: text/html; q=1.0
  88. Accept: text/html; level=9; q=0.1, text/html; level=1
  89. Available: text/html
  90. Expected: text/html; q=1.0