head.py 1.4 KB

1234567891011121314151617181920212223242526272829303132
  1. # This file is part of Radicale - CalDAV and CardDAV server
  2. # Copyright © 2008 Nicolas Kandel
  3. # Copyright © 2008 Pascal Halter
  4. # Copyright © 2008-2017 Guillaume Ayoub
  5. # Copyright © 2017-2022 Unrud <unrud@outlook.com>
  6. # Copyright © 2025-2025 Peter Bieringer <pb@bieringer.de>
  7. #
  8. # This library is free software: you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation, either version 3 of the License, or
  11. # (at your option) any later version.
  12. #
  13. # This library is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. # GNU General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License
  19. # along with Radicale. If not, see <http://www.gnu.org/licenses/>.
  20. from radicale import types
  21. from radicale.app.base import ApplicationBase
  22. from radicale.app.get import ApplicationPartGet
  23. class ApplicationPartHead(ApplicationPartGet, ApplicationBase):
  24. def do_HEAD(self, environ: types.WSGIEnviron, base_prefix: str, path: str,
  25. user: str, remote_host: str, remote_useragent: str) -> types.WSGIResponse:
  26. """Manage HEAD request."""
  27. # Body is dropped in `Application.__call__` for HEAD requests
  28. return self.do_GET(environ, base_prefix, path, user, remote_host, remote_useragent)