1
0
Fork 0
mirror of https://github.com/Kozea/Radicale.git synced 2025-09-12 20:30:57 +00:00

Extract read*_request_body methods

This commit is contained in:
Unrud 2020-09-14 21:19:48 +02:00
parent 5aef41e691
commit 6f3a95245f
10 changed files with 63 additions and 51 deletions

View file

@ -21,7 +21,7 @@ Custom web plugin.
from http import client
from radicale import web
from radicale import httputils, web
class Web(web.BaseWeb):
@ -29,5 +29,5 @@ class Web(web.BaseWeb):
return client.OK, {"Content-Type": "text/plain"}, "custom"
def post(self, environ, base_prefix, path, user):
answer = "echo:" + environ["wsgi.input"].read().decode()
return client.OK, {"Content-Type": "text/plain"}, answer
content = httputils.read_request_body(self.configuration, environ)
return client.OK, {"Content-Type": "text/plain"}, "echo:" + content