119 lines
3.2 KiB
Plaintext
119 lines
3.2 KiB
Plaintext
|
# Accept: [Accept: header value from RFC2616,
|
||
|
# http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html]
|
||
|
# Available: [whitespace-separated content types]
|
||
|
# Expected: [Accept-header like list, containing the available content
|
||
|
# types with their q-values]
|
||
|
|
||
|
Accept: */*
|
||
|
Available: text/plain
|
||
|
Expected: text/plain; q=1.0
|
||
|
|
||
|
Accept: */*
|
||
|
Available: text/plain, text/html
|
||
|
Expected: text/plain; q=1.0, text/html; q=1.0
|
||
|
|
||
|
# The order matters
|
||
|
Accept: */*
|
||
|
Available: text/html, text/plain
|
||
|
Expected: text/html; q=1.0, text/plain; q=1.0
|
||
|
|
||
|
Accept: text/*, */*; q=0.9
|
||
|
Available: text/plain, image/jpeg
|
||
|
Expected: text/plain; q=1.0, image/jpeg; q=0.9
|
||
|
|
||
|
Accept: text/*, */*; q=0.9
|
||
|
Available: image/jpeg, text/plain
|
||
|
Expected: text/plain; q=1.0, image/jpeg; q=0.9
|
||
|
|
||
|
# wildcard subtypes still reject differing main types
|
||
|
Accept: text/*
|
||
|
Available: image/jpeg, text/plain
|
||
|
Expected: text/plain; q=1.0
|
||
|
|
||
|
Accept: text/html
|
||
|
Available: text/html
|
||
|
Expected: text/html; q=1.0
|
||
|
|
||
|
Accept: text/html, text/*
|
||
|
Available: text/html
|
||
|
Expected: text/html; q=1.0
|
||
|
|
||
|
Accept: text/html, text/*
|
||
|
Available: text/plain, text/html
|
||
|
Expected: text/plain; q=1.0, text/html; q=1.0
|
||
|
|
||
|
Accept: text/html, text/*; q=0.9
|
||
|
Available: text/plain, text/html
|
||
|
Expected: text/html; q=1.0, text/plain; q=0.9
|
||
|
|
||
|
# If a more specific type has a higher q-value, then the higher value wins
|
||
|
Accept: text/*; q=0.9, text/html
|
||
|
Available: text/plain, text/html
|
||
|
Expected: text/html; q=1.0, text/plain; q=0.9
|
||
|
|
||
|
Accept: */*, text/*; q=0.9, text/html; q=0.1
|
||
|
Available: text/plain, text/html, image/monkeys
|
||
|
Expected: image/monkeys; q=1.0, text/plain; q=0.9, text/html; q=0.1
|
||
|
|
||
|
Accept: text/*, text/html; q=0
|
||
|
Available: text/html
|
||
|
Expected:
|
||
|
|
||
|
Accept: text/*, text/html; q=0
|
||
|
Available: text/html, text/plain
|
||
|
Expected: text/plain; q=1.0
|
||
|
|
||
|
Accept: text/html
|
||
|
Available: text/plain
|
||
|
Expected:
|
||
|
|
||
|
Accept: application/xrds+xml, text/html; q=0.9
|
||
|
Available: application/xrds+xml, text/html
|
||
|
Expected: application/xrds+xml; q=1.0, text/html; q=0.9
|
||
|
|
||
|
Accept: application/xrds+xml, */*; q=0.9
|
||
|
Available: application/xrds+xml, text/html
|
||
|
Expected: application/xrds+xml; q=1.0, text/html; q=0.9
|
||
|
|
||
|
Accept: application/xrds+xml, application/xhtml+xml; q=0.9, text/html; q=0.8, text/xml; q=0.7
|
||
|
Available: application/xrds+xml, text/html
|
||
|
Expected: application/xrds+xml; q=1.0, text/html; q=0.8
|
||
|
|
||
|
# See http://www.rfc-editor.org/rfc/rfc3023.txt, section A.13
|
||
|
Accept: application/xrds
|
||
|
Available: application/xrds+xml
|
||
|
Expected:
|
||
|
|
||
|
Accept: application/xrds+xml
|
||
|
Available: application/xrds
|
||
|
Expected:
|
||
|
|
||
|
Accept: application/xml
|
||
|
Available: application/xrds+xml
|
||
|
Expected:
|
||
|
|
||
|
Available: application/xrds+xml
|
||
|
Accept: application/xml
|
||
|
Expected:
|
||
|
|
||
|
|
||
|
|
||
|
#################################################
|
||
|
# The tests below this line are documentation of how this library
|
||
|
# works. If the implementation changes, it's acceptable to change the
|
||
|
# test to reflect that. These are specified so that we can make sure
|
||
|
# that the current implementation actually works the way that we
|
||
|
# expect it to given these inputs.
|
||
|
|
||
|
Accept: text/html;level=1
|
||
|
Available: text/html
|
||
|
Expected: text/html; q=1.0
|
||
|
|
||
|
Accept: text/html; level=1, text/html; level=9; q=0.1
|
||
|
Available: text/html
|
||
|
Expected: text/html; q=1.0
|
||
|
|
||
|
Accept: text/html; level=9; q=0.1, text/html; level=1
|
||
|
Available: text/html
|
||
|
Expected: text/html; q=1.0
|