From 315e08a1c3bdbea645fdf2d1ead304ceb2b7dbc0 Mon Sep 17 00:00:00 2001 From: Kyle Carberry Date: Tue, 10 Oct 2023 03:23:50 +0000 Subject: [PATCH] fix: use query to get external-auth by id --- coderd/workspaceagents.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/coderd/workspaceagents.go b/coderd/workspaceagents.go index a5e78562866f4..5a477361dee68 100644 --- a/coderd/workspaceagents.go +++ b/coderd/workspaceagents.go @@ -2177,13 +2177,14 @@ func (api *API) postWorkspaceAppHealth(rw http.ResponseWriter, r *http.Request) // @Router /workspaceagents/me/external-auth [get] func (api *API) workspaceAgentsExternalAuth(rw http.ResponseWriter, r *http.Request) { ctx := r.Context() + query := r.URL.Query() // Either match or configID must be provided! - match := r.URL.Query().Get("match") + match := query.Get("match") if match == "" { // Support legacy agents! - match = r.URL.Query().Get("url") + match = query.Get("url") } - id := chi.URLParam(r, "id") + id := query.Get("id") if match == "" && id == "" { httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{ Message: "'url' or 'id' must be provided!",