// Returns the degree to which the two media types match, or #f if they
// don't match at all. Points are assigned as follows:
// * 100 - major mime type matches exactly (not a wildcard match)
// * 100 - mime subtype matches exactly (not a wildcard match)
// * 1 - wildcard match for type or subtype
// * 1 - for each attribute (excluding "q") that matches exactly
// Matching type/subtype trumps all else.
And indeed the first media type matches the mime type (and it gets a score of 100) while the second one matches the wildcard for the mime type (and it gets a score of 1).
So who should I trust? The test suite (and change the function accordingly) or the function (and change the test suite)?
Running the http-common test suite fails. The errors are:
The test suite expects
to be
#f
, but if we look at the definition ofmatch-media-types
we can read:And indeed the first media type matches the mime type (and it gets a score of 100) while the second one matches the wildcard for the mime type (and it gets a score of 1).
So who should I trust? The test suite (and change the function accordingly) or the function (and change the test suite)?