Skip to content

Commit

Permalink
Close Zeroconf server when exiting
Browse files Browse the repository at this point in the history
  • Loading branch information
devgianlu committed Oct 19, 2023
1 parent df81ee5 commit 55f682e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions zeroconf/zeroconf.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ func (z *Zeroconf) handleAddUser(writer http.ResponseWriter, request *http.Reque
type HandleNewRequestFunc func(req NewUserRequest) bool

func (z *Zeroconf) Serve(handler HandleNewRequestFunc) error {
defer z.server.Shutdown()

mux := http.NewServeMux()
mux.HandleFunc("/", func(writer http.ResponseWriter, request *http.Request) {
if err := request.ParseForm(); err != nil {
Expand Down

0 comments on commit 55f682e

Please sign in to comment.