From 3eb9a43190a222c6c88551ddc19b4216cb0356b9 Mon Sep 17 00:00:00 2001 From: Kyle Carberry Date: Mon, 9 Oct 2023 22:25:50 -0500 Subject: [PATCH] fix: use query to get external-auth by id (#10156) --- coderd/workspaceagents.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/coderd/workspaceagents.go b/coderd/workspaceagents.go index a5e7856286..5a477361de 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!",