Skip to content

Commit

Permalink
no more nil check
Browse files Browse the repository at this point in the history
  • Loading branch information
jmhodges committed Jul 30, 2024
1 parent edb0579 commit 57274df
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,9 @@ func (a *autographer) handleSignature(w http.ResponseWriter, r *http.Request) {
starttime := getRequestStartTime(r)
auth, userid, err := a.authorizeHeader(r)
if err != nil {
if a.stats != nil {
sendStatsErr := a.stats.Timing("hawk.authorize_header_failed", time.Since(starttime), nil, 1.0)
if sendStatsErr != nil {
log.Warnf("Error sending hawk.authorize_header_failed: %s", sendStatsErr)
}
sendStatsErr := a.stats.Timing("hawk.authorize_header_failed", time.Since(starttime), nil, 1.0)
if sendStatsErr != nil {
log.Warnf("Error sending hawk.authorize_header_failed: %s", sendStatsErr)
}
httpError(w, r, http.StatusUnauthorized, "authorization verification failed: %v", err)
return
Expand Down

0 comments on commit 57274df

Please sign in to comment.