Skip to content

Commit

Permalink
Check error code of Write
Browse files Browse the repository at this point in the history
  • Loading branch information
martinbjeldbak committed Aug 27, 2022
1 parent ae43fe3 commit 443828c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion commands/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ var authCmd = &cobra.Command{
w.WriteHeader(http.StatusNotFound)
return
}
w.Write(file)
_, err = w.Write(file)
if err != nil {
fmt.Printf("Error writing to response: %v", err)
w.WriteHeader(http.StatusNotFound)
return
}
})

if err := http.ListenAndServe(fmt.Sprintf(":%v", localCallbackPort), nil); err != nil {
Expand Down

0 comments on commit 443828c

Please sign in to comment.