Skip to content

Commit 6ff8584

Browse files
authored
safeweb: add a Shutdown method to the Server type (tailscale#14048)
Updates tailscale#14047 Change-Id: I2d20454c715b11ad9c6aad1d81445e05a170c3a2 Signed-off-by: M. J. Fromberger <[email protected]>
1 parent 64d70fb commit 6ff8584

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

safeweb/http.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ package safeweb
7171

7272
import (
7373
"cmp"
74+
"context"
7475
crand "crypto/rand"
7576
"fmt"
7677
"log"
@@ -416,3 +417,7 @@ func (s *Server) ListenAndServe(addr string) error {
416417
func (s *Server) Close() error {
417418
return s.h.Close()
418419
}
420+
421+
// Shutdown gracefully shuts down the server without interrupting any active
422+
// connections. It has the same semantics as[http.Server.Shutdown].
423+
func (s *Server) Shutdown(ctx context.Context) error { return s.h.Shutdown(ctx) }

0 commit comments

Comments
 (0)