[Seaside-dev] HEAD HTTP method handling in RESTful handlers/filters

Esteban Maringolo emaringolo at gmail.com
Tue Aug 3 19:11:27 UTC 2021


Hi all,

On Tue, Aug 3, 2021 at 2:08 PM Max Leske <maxleske at gmail.com> wrote:
>  By "retry performing a regular GET request as a fallback" you mean running the handler for a GET request for that route but return only the headers, right?

Exactly.

> I wonder how that is handled at the moment.
> Is the body being discarded after having been assembled?

That's what's done, but this is done in the WAServerAdaptor implementation.

Which might be the "simplest thing" and it certainly works in 99.9999%
of cases, except if you want to directly deal with a HEAD request in a
Seaside request handler.


> There's probably no other way, as you have to know the data you would be sending (e.g., for Content-Length).

That was my doubt, but the spec says that the HEAD headers SHOULD be
the same headers as for a normal GET. So it could be the case that you
return a HEAD with Content-Length: 0.

I submitted a PR for this, let's see if somebody else has something to
add or if there are reasons to reject it.

Best regards!

Esteban A. Maringolo


More information about the seaside-dev mailing list