Closed cbeer closed 10 years ago
Per RFC 7240, parameters aren't included in the Preference-Applied response header.
The syntax of the Preference-Applied header differs from that of the Prefer
header in that parameters are not included.
Here is the ABNF grammar.
Preference-Applied = "Preference-Applied" ":" 1#applied-pref
applied-pref = token [ BWS "=" BWS word ]
A server could return more than one applied preference, which the regex won't match. For instance,
Preference-Applied: return=representation, foo=bar
The request from the test suite only has one preference in the Prefer header, however, so there should only be one applied preference in the response.
Having said that, I'm not sure the existing regex in the test suite is correct, either. It should probably be something more like
^return\s*=\s*"?representation"?$
Ah, thanks for the link to the RFC. I was looking at an older draft. I'll take a look and update this pull request if the regex needs an update.
Without this change, a response including other data won't match, e.g.: