Skip to content

Commit c5ddb86

Browse files
committed
chore: return forbidden over internal error agent get ssh key
1 parent 2bdc470 commit c5ddb86

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

coderd/gitsshkey.go

Lines changed: 4 additions & 0 deletions
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)