Skip to content

Commit 20f409f

Browse files
authored
Default to SSE proxy mode in API (#1495)
1 parent db3b158 commit 20f409f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pkg/api/v1/workloads.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,16 @@ func (s *WorkloadRoutes) createWorkload(w http.ResponseWriter, r *http.Request)
282282
}
283283
}
284284

285+
// Default proxy mode to SSE if not specified
286+
if !types.IsValidProxyMode(req.ProxyMode) {
287+
if req.ProxyMode == "" {
288+
req.ProxyMode = types.ProxyModeSSE.String()
289+
} else {
290+
http.Error(w, "Invalid proxy_mode", http.StatusBadRequest)
291+
return
292+
}
293+
}
294+
285295
// Create the workload using shared logic
286296
runConfig, err := s.createWorkloadFromRequest(ctx, &req)
287297
if err != nil {

0 commit comments

Comments
 (0)