adlnet / xAPIWrapper

Wrapper to simplify communication to an LRS
https://adlnet.gov/projects/xapi/
Apache License 2.0
219 stars 114 forks source link

If-Match, If-None-Match not conformant with RFC2616 #93

Closed cawerkenthin closed 7 years ago

cawerkenthin commented 7 years ago

The special case of "" for the matchHash should not include quotes. For example: If-None-Match:
is correct, but If-None-Match: "*" is not correct. See https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.26

This can be fixed by using the following function: function formatHash(hash) { if (hash === "*") { return hash; } return '"' + hash + '"'; }

Usage example: headers = { "If-Match": formatHash(matchHash) };

ajanderson1209 commented 7 years ago

Thank you for the info. The fix is merged and should take care of this problem. Thanks!