It's worth pointing out that while WSGI apps in general have that issue,
webob (and thus pyramid apps) automatically handle this.

1) webob automatically truncates the body on a head request.
2) pyramid automatically configures any view that takes
`request_method='GET'` to also take HEAD and documents that it does that.

- Michael

On Sun, Oct 20, 2019 at 4:46 PM Bert JW Regeer <xiste...@0x58.com> wrote:

> If your WSGI application for instance does not natively support HEAD
> requests, because it only handles GET requests, you can use this middleware
> to do the rewrite, have your WSGI app return the whole response, and
> Guillotine will then return a body less response to the remote client.
>
> Bert
>
> On Oct 18, 2019, at 15:47, Jens Troeger <jens.troe...@gmail.com> wrote:
>
> Hello,
>
> Today I stumbled upon a somewhat dated Pylons project called Guillotine
> <https://github.com/Pylons/guillotine>, a WSGI middleware
> <https://docs.pylonsproject.org/projects/pyramid/en/1.10-branch/glossary.html#term-middleware>
> extension. It seems to have only one purpose: rewrite the request method of
> HEAD requests into GET.
>
> Now I am curious about the *why*. A HEAD request is, as per documentation
> <https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/HEAD>, pretty
> much a GET without body. So what’s the purpose then of this particular
> extension and the rewrite?
>
> Much thanks,
> Jens
>
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pylons-discuss+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pylons-discuss/cd9466d9-47ce-410f-9b36-5a47417cf8f2%40googlegroups.com
> <https://groups.google.com/d/msgid/pylons-discuss/cd9466d9-47ce-410f-9b36-5a47417cf8f2%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pylons-discuss+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pylons-discuss/F107895E-EF6E-4FEA-8971-AC414FADC28A%400x58.com
> <https://groups.google.com/d/msgid/pylons-discuss/F107895E-EF6E-4FEA-8971-AC414FADC28A%400x58.com?utm_medium=email&utm_source=footer>
> .
>


-- 

Michael

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pylons-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/CAKdhhwHaxnMyu%3D%2BcS6rzGWiGcb0L83i-pdCrCFvD-94WYHz0fg%40mail.gmail.com.

Reply via email to