Description
PR #3122 broke support for APIs using the HEAD
method. Below is the discussion context from that PR held post merge.
Does this work? This worries me, and seems like we no longer have HEAD
implementations for our GET
APIs. Normally, Flask implements a HEAD
as a GET
and discards the response payload (returning only headers). I don't think it does that if the head
method is implemented, which you're now doing anywhere, so I think a HEAD
ought to now go through to the fallback (not implemented) "abstract" _head
.
While I'm not against the idea of being able to implement a specialized _head
I don't think this way will work.
Or at least, I know that a HEAD /api/v1/datasets/list
worked before, and I'm not confident that it'll work with these changes. (In fact, I don't see how it could.)
Originally posted by @dbutenhof in #3122 (comment)
Yes, you are correct that a
HEAD
operation is not working now. I knew the client allowed it, but didn't think twice about this because we have no tests that exercise theHEAD
operation. I have added one to the functional tests in PR #3123.I am not a fan of this Flask behavior. For certain APIs we really want a separate method for the
HEAD
operation so that it does not consume server side resources unnecessarily. Pulling a large tar ball or a large query set can be costly.I'll noodle about this and post a PR with a suggested way to address this.
Originally posted by @portante in #3122 (comment)
Metadata
Metadata
Assignees
Type
Projects
Status