diff --git a/test/server.go b/test/server.go index 35ad206..5290dfe 100644 --- a/test/server.go +++ b/test/server.go @@ -41,7 +41,6 @@ type server struct { cfg *cfg.Config db *sql.DB dbPath string - handler front.Handler Alice *ap.Actor Bob *ap.Actor Carol *ap.Actor @@ -94,16 +93,10 @@ func newTestServer() *server { panic(err) } - handler, err := front.NewHandler(domain, false, &cfg, fed.NewResolver(nil, domain, &cfg, &http.Client{}, db), db) - if err != nil { - panic(err) - } - return &server{ cfg: &cfg, dbPath: path, db: db, - handler: handler, Alice: alice, Bob: bob, Carol: carol, @@ -117,9 +110,14 @@ func (s *server) Handle(request string, user *ap.Actor) string { panic(err) } + handler, err := front.NewHandler(domain, false, s.cfg, fed.NewResolver(nil, domain, s.cfg, &http.Client{}, s.db), s.db) + if err != nil { + panic(err) + } + var buf bytes.Buffer w := gmi.Wrap(&buf) - s.handler.Handle( + handler.Handle( &front.Request{ Context: context.Background(), URL: u, @@ -140,9 +138,14 @@ func (s *server) Upload(request string, user *ap.Actor, body []byte) string { } u.Scheme = "titan" + handler, err := front.NewHandler(domain, false, s.cfg, fed.NewResolver(nil, domain, s.cfg, &http.Client{}, s.db), s.db) + if err != nil { + panic(err) + } + var buf bytes.Buffer w := gmi.Wrap(&buf) - s.handler.Handle( + handler.Handle( &front.Request{ Context: context.Background(), URL: u,