client/web: remove unused context param from NewServer

Updates tailscale/corp#14335

Signed-off-by: Sonia Appasamy <sonia@tailscale.com>
pull/9752/head
Sonia Appasamy 1 year ago committed by Sonia Appasamy
parent aad3584319
commit 7a0de2997e

@ -125,8 +125,7 @@ type ServerOpts struct {
} }
// NewServer constructs a new Tailscale web client server. // NewServer constructs a new Tailscale web client server.
// The provided context should live for the duration of the Server's lifetime. func NewServer(opts ServerOpts) (s *Server, cleanup func()) {
func NewServer(ctx context.Context, opts ServerOpts) (s *Server, cleanup func()) {
if opts.LocalClient == nil { if opts.LocalClient == nil {
opts.LocalClient = &tailscale.LocalClient{} opts.LocalClient = &tailscale.LocalClient{}
} }

@ -80,7 +80,7 @@ func runWeb(ctx context.Context, args []string) error {
return fmt.Errorf("too many non-flag arguments: %q", args) return fmt.Errorf("too many non-flag arguments: %q", args)
} }
webServer, cleanup := web.NewServer(ctx, web.ServerOpts{ webServer, cleanup := web.NewServer(web.ServerOpts{
DevMode: webArgs.dev, DevMode: webArgs.dev,
CGIMode: webArgs.cgi, CGIMode: webArgs.cgi,
PathPrefix: webArgs.prefix, PathPrefix: webArgs.prefix,

@ -5,7 +5,6 @@
package main package main
import ( import (
"context"
"flag" "flag"
"log" "log"
"net/http" "net/http"
@ -21,7 +20,6 @@ var (
func main() { func main() {
flag.Parse() flag.Parse()
ctx := context.Background()
s := new(tsnet.Server) s := new(tsnet.Server)
defer s.Close() defer s.Close()
@ -32,7 +30,7 @@ func main() {
} }
// Serve the Tailscale web client. // Serve the Tailscale web client.
ws, cleanup := web.NewServer(ctx, web.ServerOpts{ ws, cleanup := web.NewServer(web.ServerOpts{
DevMode: *devMode, DevMode: *devMode,
LocalClient: lc, LocalClient: lc,
}) })

Loading…
Cancel
Save