comparison sat/plugins/plugin_comp_ap_gateway/http_server.py @ 4005:54a6b44f173b

component AP gateway: reset stream position after getting payload: the stream position needs to be reset, as the body may be read again to compute signature hash.
author Goffi <goffi@goffi.org>
date Thu, 16 Mar 2023 12:28:52 +0100
parents 7a6c7abd7dbb
children 48e8b3dba793
comparison
equal deleted inserted replaced
4004:cd6f70015738 4005:54a6b44f173b
1040 http.BAD_REQUEST, 1040 http.BAD_REQUEST,
1041 f"invalid json in inbox request: {e}" 1041 f"invalid json in inbox request: {e}"
1042 ) 1042 )
1043 request.finish() 1043 request.finish()
1044 return 1044 return
1045 else:
1046 request.content.seek(0)
1047
1045 try: 1048 try:
1046 if data["type"] == "Delete" and data["actor"] == data["object"]: 1049 if data["type"] == "Delete" and data["actor"] == data["object"]:
1047 # we don't handle actor deletion 1050 # we don't handle actor deletion
1048 request.setResponseCode(http.ACCEPTED) 1051 request.setResponseCode(http.ACCEPTED)
1049 log.debug(f"ignoring actor deletion ({data['actor']})") 1052 log.debug(f"ignoring actor deletion ({data['actor']})")