Skip to content

Replace error-deferred for HEAD implementation#322

Open
tggreene wants to merge 1 commit intojuxt:masterfrom
tggreene:fix-head-deferred
Open

Replace error-deferred for HEAD implementation#322
tggreene wants to merge 1 commit intojuxt:masterfrom
tggreene:fix-head-deferred

Conversation

@tggreene
Copy link

Currently we're creating deferred errors which are never consumed (these log
exceptions when the next GC cycle runs), instead we can simply throw exceptions to be
caught be the outer deferred chain and handled in the normal catch block in
yada.handler/handle-request-with-maybe-subresources.

The only distinction from existing behaviour is that we will now return a 406 in
line with GET when we have no available representation for the HEAD, whereas
previously we would return a 200.

This aligns with the principle that the HEAD response should reflect the GET
other than providing a response body.

This PR should address #206.

Currently we're creating deferred errors which are never consumed (these log
exceptions when the next GC cycle runs), instead we can simply throw to be
caught be the outer deferred chain and handled in the normal catch block in
yada.handler/handle-request-with-maybe-subresources.

The only distinction from existing behaviour is that we will now return a 406 in
line with GET when we have no available representation for the HEAD, whereas
previously we would return a 200.

This aligns with the principle that the HEAD response should reflect the GET
other than providing a response body.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant