Skip to content

Commit 70ea82d

Browse files

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

polycode/task.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,11 @@ func runTask(ctx context.Context, event any) (evt *TaskCompleteEvent) {
222222
return errorToTaskComplete(ErrBadRequest)
223223
}
224224

225+
method := it.Header.Get("x-polycode-task-api-method")
226+
if method == "" {
227+
return errorToTaskComplete(ErrBadRequest)
228+
}
229+
225230
workflowCtx := WorkflowContext{
226231
ctx: ctx,
227232
sessionId: sessionId,
@@ -231,6 +236,7 @@ func runTask(ctx context.Context, event any) (evt *TaskCompleteEvent) {
231236
wkfCtx := context.WithValue(it.Context(), "polycode.context", workflowCtx)
232237
it = it.WithContext(wkfCtx)
233238
it.URL.Path = path
239+
it.Method = method
234240

235241
println(fmt.Sprintf("client: invoke handler %s with session id %s", path, sessionId))
236242
resp := invokeHandler(httpHandler, it)

0 commit comments

Comments
 (0)