Skip to content

Commit

Permalink
Merge branch 'master' into fix_basic_auth_timing_oracle
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkerou authored Jan 13, 2021
2 parents 883f032 + 46ddd42 commit 705955b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1793,8 +1793,8 @@ func main() {
// Initializing the server in a goroutine so that
// it won't block the graceful shutdown handling below
go func() {
if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed {
log.Fatalf("listen: %s\n", err)
if err := srv.ListenAndServe(); err != nil && errors.Is(err, http.ErrServerClosed) {
log.Printf("listen: %s\n", err)
}
}()

Expand All @@ -1812,6 +1812,7 @@ func main() {
// the request it is currently handling
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()

if err := srv.Shutdown(ctx); err != nil {
log.Fatal("Server forced to shutdown:", err)
}
Expand Down

0 comments on commit 705955b

Please sign in to comment.