post.py 1.4 KB

123456789101112131415161718192021222324252627282930313233
  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-2021 Unrud <unrud@outlook.com>
  6. # Copyright © 2020-2020 Tom Hacohen <tom@stosb.com>
  7. # Copyright © 2025-2025 Peter Bieringer <pb@bieringer.de>
  8. #
  9. # This library is free software: you can redistribute it and/or modify
  10. # it under the terms of the GNU General Public License as published by
  11. # the Free Software Foundation, either version 3 of the License, or
  12. # (at your option) any later version.
  13. #
  14. # This library is distributed in the hope that it will be useful,
  15. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. # GNU General Public License for more details.
  18. #
  19. # You should have received a copy of the GNU General Public License
  20. # along with Radicale. If not, see <http://www.gnu.org/licenses/>.
  21. from radicale import httputils, types
  22. from radicale.app.base import ApplicationBase
  23. class ApplicationPartPost(ApplicationBase):
  24. def do_POST(self, environ: types.WSGIEnviron, base_prefix: str,
  25. path: str, user: str, remote_host: str, remote_useragent: str) -> types.WSGIResponse:
  26. """Manage POST request."""
  27. if path == "/.web" or path.startswith("/.web/"):
  28. return self._web.post(environ, base_prefix, path, user)
  29. return httputils.METHOD_NOT_ALLOWED