Skip to content

Commit b5ed0bd

Browse files
EmyrkThomasK33
authored andcommitted
chore: return forbidden over internal error agent get ssh key (#17713)
1 parent 60faeb9 commit b5ed0bd

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy