Mercurial > libervia-backend
comparison libervia/backend/plugins/plugin_comp_ap_gateway/http_server.py @ 4093:13b1079c27ec
component AP gateway: fix method retrieval in `ap_request`:
following recent refactoring to use snake_case, the former method retrieve was broken,
this patch fixes it.
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 12 Jun 2023 14:45:13 +0200 |
parents | 4b842c1fb686 |
children | 58bbc100f13b |
comparison
equal
deleted
inserted
replaced
4092:74c66c0d93f3 | 4093:13b1079c27ec |
---|---|
1027 account_jid, node = await self.apg.get_jid_and_node(ap_account) | 1027 account_jid, node = await self.apg.get_jid_and_node(ap_account) |
1028 if request_type not in AP_REQUEST_TYPES.get( | 1028 if request_type not in AP_REQUEST_TYPES.get( |
1029 request.method.decode().upper(), [] | 1029 request.method.decode().upper(), [] |
1030 ): | 1030 ): |
1031 raise exceptions.DataError(f"Invalid request type: {request_type!r}") | 1031 raise exceptions.DataError(f"Invalid request type: {request_type!r}") |
1032 method = getattr(self, f"AP{request_type.title()}Request") | 1032 method = getattr(self, f"ap_{request_type}_request") |
1033 ret_data = await method( | 1033 ret_data = await method( |
1034 request, data, account_jid, node, ap_account, ap_url, signing_actor | 1034 request, data, account_jid, node, ap_account, ap_url, signing_actor |
1035 ) | 1035 ) |
1036 if ret_data is not None: | 1036 if ret_data is not None: |
1037 request.setHeader("content-type", CONTENT_TYPE_AP) | 1037 request.setHeader("content-type", CONTENT_TYPE_AP) |