tsweb: add StdHandlerOpts that accepts an options struct

I'm about to add yet another StdHandler option.
Time to refactor.

Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
This commit is contained in:
Josh Bleecher Snyder
2020-10-29 13:55:42 -07:00
committed by Josh Bleecher Snyder
parent eab6e9ea4e
commit e98f2c57d6
2 changed files with 29 additions and 17 deletions

View File

@@ -248,7 +248,7 @@ func TestStdHandler(t *testing.T) {
clock.Reset()
rec := noopHijacker{httptest.NewRecorder(), false}
h := stdHandler(test.rh, logf, clock.Now, true)
h := StdHandlerOpts(test.rh, HandlerOptions{Logf: logf, Now: clock.Now})
h.ServeHTTP(&rec, test.r)
res := rec.Result()
if res.StatusCode != test.wantCode {