fix: require namespace for workflow operations, return 400 if missing
CI / CI (push) Failing after 7m51s
CI / CI (push) Failing after 7m51s
Temporal handler was defaulting to 'default' namespace when not provided. CI test expects 400 for missing namespace. Validate before forwarding.
This commit is contained in:
@@ -134,8 +134,13 @@ func (wa *WorkflowAdapter) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
// Inject action into body for temporal handler
|
// Inject action into body for temporal handler
|
||||||
payload["action"] = action
|
payload["action"] = action
|
||||||
if _, ok := payload["namespace"]; !ok {
|
|
||||||
payload["namespace"] = "default"
|
// namespace is required for all workflow operations
|
||||||
|
if ns, ok := payload["namespace"].(string); !ok || ns == "" {
|
||||||
|
w.Header().Set("Content-Type", "application/json")
|
||||||
|
w.WriteHeader(http.StatusBadRequest)
|
||||||
|
fmt.Fprintf(w, `{"error":"namespace is required"}`)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
newBody, _ := json.Marshal(payload)
|
newBody, _ := json.Marshal(payload)
|
||||||
|
|||||||
Reference in New Issue
Block a user