forked from forgejo/forgejo
Backport #28796 by @wxiaoguang `resp != nil` doesn't mean the request really succeeded. Add a comment for requestJSONResp to clarify the behavior. Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
parent
df694f6a7d
commit
cbf366643b
4 changed files with 4 additions and 3 deletions
|
@ -27,7 +27,7 @@ func AuthorizedPublicKeyByContent(ctx context.Context, content string) (string,
|
|||
req := newInternalRequest(ctx, reqURL, "POST")
|
||||
req.Param("content", content)
|
||||
resp, extra := requestJSONResp(req, &responseText{})
|
||||
if resp == nil {
|
||||
if extra.HasError() {
|
||||
return "", extra
|
||||
}
|
||||
return resp.Text, extra
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue