Skip to content

Commit 0d0cac0

Browse files
committed
[bug] Copilot fixes: HTTP header issues, nit in doc
1 parent ac2d4f2 commit 0d0cac0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pkg/api/controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -969,13 +969,12 @@ func (c *Controller) ReleaseTokenToMailbox(w http.ResponseWriter, r *http.Reques
969969
// This endpoint is _usually_ visited by a browser. Report to the user that
970970
// they logged in, telling them the name they used to log in.
971971
httputil.KeepPrivate(w)
972+
w.WriteHeader(http.StatusOK)
972973

973974
err = releasedTokenTemplate.ExecuteTemplate(w, "releasedToken", &UserData{Username: username})
974975
if c.handleAPIError(ctx, w, r, err) {
975976
return
976977
}
977-
978-
w.WriteHeader(http.StatusOK)
979978
default:
980979
writeResponse(w, r, http.StatusNoContent, nil)
981980
}
@@ -6239,6 +6238,7 @@ func (c *Controller) GetUsageReportSummary(w http.ResponseWriter, r *http.Reques
62396238
// base on content-type return plain text or json (default)
62406239
if r.Header.Get("Accept") == "text/plain" {
62416240
httputil.KeepPrivate(w)
6241+
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
62426242
_, _ = fmt.Fprintf(w, "Usage for installation ID: %s\n", installationID)
62436243
for _, rec := range records {
62446244
_, _ = fmt.Fprintf(w, "%d-%02d: %12d\n", rec.Year, rec.Month, rec.Count)

pkg/authentication/tokens.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ type LoginTokenProvider interface {
1818
// called authenticated, initiated by the web browser running.
1919
Release(ctx context.Context, loginRequestToken string) error
2020
// GetToken returns a token waiting on mailbox. It is called unauthenticated, initiated
21-
// the requesting client, with no user on the context..
21+
// the requesting client, with no user on the context.
2222
GetToken(ctx context.Context, mailbox string) (string, time.Time, error)
2323
}

0 commit comments

Comments
 (0)