Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2e7f045

Browse files
authored
chore: return forbidden over internal error agent get ssh key (#17713)
1 parent 6cc4a85 commit 2e7f045

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

coderd/gitsshkey.go

+4
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ func (api *API) agentGitSSHKey(rw http.ResponseWriter, r *http.Request) {
145145
}
146146

147147
gitSSHKey, err := api.Database.GetGitSSHKey(ctx, workspace.OwnerID)
148+
if httpapi.IsUnauthorizedError(err) {
149+
httpapi.Forbidden(rw)
150+
return
151+
}
148152
if err != nil {
149153
httpapi.Write(ctx, rw, http.StatusInternalServerError, codersdk.Response{
150154
Message: "Internal error fetching git SSH key.",

0 commit comments

Comments
 (0)