Skip to content

Comments

Http ifmatch#14630

Merged
sideshowbarker merged 3 commits intomdn:mainfrom
hamishwillee:http_ifmatch
Apr 4, 2022
Merged

Http ifmatch#14630
sideshowbarker merged 3 commits intomdn:mainfrom
hamishwillee:http_ifmatch

Conversation

@hamishwillee
Copy link
Collaborator

Fixes #14557

The document indicated that you might use If-Match with a range request to ensure that the requested range is from the same resource (true) and that if it was not from the same resource you'd get HTTP 416 error. However the specs corroborate the testing in #14557

  • If-Match returns 412 if the match is false.
  • Range always is preformed after a conditional. If it fails it returns 416.

So in essence you'll only get 416 if the range is "bad", but from the point of view of the If-Match docs that is a bit irrelevant.

I've tidied the docs to make it clear that you always get 412 - they were written like you might get different behaviour for put vs get/head requests. Also some minor other points from the spec (e.g. related to *).

@hamishwillee hamishwillee requested a review from a team as a code owner April 4, 2022 01:17
@hamishwillee hamishwillee requested review from teoli2003 and removed request for a team April 4, 2022 01:17
@github-actions github-actions bot added the Content:HTTP HTTP docs label Apr 4, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Apr 4, 2022

@sideshowbarker sideshowbarker merged commit 0333e53 into mdn:main Apr 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:HTTP HTTP docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue with "If-Match": (A false If-Match condition should return a 412 not a 416)

2 participants