Skip to content

Commit 3977706

Browse files
committed
[bug] Copilot fixes: HTTP header issues, nit in doc
1 parent 7bca8f9 commit 3977706

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
@@ -986,13 +986,12 @@ func (c *Controller) ReleaseTokenToMailbox(w http.ResponseWriter, r *http.Reques
986986
// This endpoint is _usually_ visited by a browser. Report to the user that
987987
// they logged in, telling them the name they used to log in.
988988
httputil.KeepPrivate(w)
989+
w.WriteHeader(http.StatusOK)
989990

990991
err = releasedTokenTemplate.ExecuteTemplate(w, "releasedToken", &UserData{Username: username})
991992
if c.handleAPIError(ctx, w, r, err) {
992993
return
993994
}
994-
995-
w.WriteHeader(http.StatusOK)
996995
default:
997996
writeResponse(w, r, http.StatusNoContent, nil)
998997
}
@@ -6316,6 +6315,7 @@ func (c *Controller) GetUsageReportSummary(w http.ResponseWriter, r *http.Reques
63166315
// base on content-type return plain text or json (default)
63176316
if r.Header.Get("Accept") == "text/plain" {
63186317
httputil.KeepPrivate(w)
6318+
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
63196319
_, _ = fmt.Fprintf(w, "Usage for installation ID: %s\n", installationID)
63206320
for _, rec := range records {
63216321
_, _ = 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)