Skip to content

Commit 85a91bd

Browse files
authored
Merge pull request #71 from serv-c/drgroot-patch-1
feat(http): adding in param to overload payload
2 parents b9d26c9 + f277fea commit 85a91bd

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

servc/svc/com/http/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ def _health(self):
116116
def _getResponse(self, id: str):
117117
return jsonify(self._cache.getKey(id))
118118

119-
def _postMessage(self):
119+
def _postMessage(self, extra_params: Dict | None = None):
120+
if not extra_params:
121+
extra_params = {}
120122
content_type = request.headers.get("Content-Type", None)
121123
if request.method == "GET":
122124
return self._getInformation()
@@ -154,6 +156,11 @@ def _postMessage(self):
154156
"id": body["id"] if "id" in body else "",
155157
"argument": body["argument"],
156158
}
159+
if isinstance(body["argument"], dict):
160+
payload["argument"] = {
161+
**payload["argument"],
162+
**extra_params,
163+
}
157164
if "instanceId" in body:
158165
payload["instanceId"] = body["instanceId"]
159166
force: bool = True if "force" in body and body["force"] else False

0 commit comments

Comments
 (0)