waf.Server and rproxy.Server no longer embed *http.Server. Each holds Go's server in a private httpServer field and is that server's handler. Every setting New made stays.
New interface, in internal/sww/lifecycle.go beside serve:
New methods, on both waf.Server and rproxy.Server:
Serve, Shutdown, Close: each calls Go's server's method of that name.
ServeHTTP: passes the request to the package's handler.
sww provides each Server as a daemonServer with fx.Annotate and fx.As; the two providers that took out the embedded server are gone. rproxy also keeps fx.Self(), since run calls WaitForReports on *rproxy.Server.
Tests:
Calls to server.Handler.ServeHTTP are now server.ServeHTTP.
The waf test helper wafAndParts has its own Addr field, which serve sets to the listener's address.
Judgement call: TestServerHasTheFixedLimits, TestServerHasTheTimeLimitsSPECGives and TestQuestionWhoseBodyStopsArrivingGetsNoAnswer reach Go's server through HTTPServer(). That method is in each package's export_test.go, so only tests see it. The checked values are unchanged; in the waf limits test the variable holding the server is renamed.
Model: opus-5-5
Closes https://git.eeqj.de/sneak/smallwebwaf/issues/437
`waf.Server` and `rproxy.Server` no longer embed `*http.Server`. Each holds Go's server in a private `httpServer` field and is that server's handler. Every setting `New` made stays.
New interface, in `internal/sww/lifecycle.go` beside `serve`:
- `daemonServer`: `Serve(net.Listener) error`, `Shutdown(context.Context) error`, `Close() error`.
New methods, on both `waf.Server` and `rproxy.Server`:
- `Serve`, `Shutdown`, `Close`: each calls Go's server's method of that name.
- `ServeHTTP`: passes the request to the package's handler.
`sww` provides each `Server` as a `daemonServer` with `fx.Annotate` and `fx.As`; the two providers that took out the embedded server are gone. rproxy also keeps `fx.Self()`, since `run` calls `WaitForReports` on `*rproxy.Server`.
Tests:
- Calls to `server.Handler.ServeHTTP` are now `server.ServeHTTP`.
- The waf test helper `wafAndParts` has its own `Addr` field, which `serve` sets to the listener's address.
- Judgement call: `TestServerHasTheFixedLimits`, `TestServerHasTheTimeLimitsSPECGives` and `TestQuestionWhoseBodyStopsArrivingGetsNoAnswer` reach Go's server through `HTTPServer()`. That method is in each package's `export_test.go`, so only tests see it. The checked values are unchanged; in the waf limits test the variable holding the server is renamed.
Model: opus-5-5
clawbot
self-assigned this 2026-11-20 01:33:27 +01:00
Neither Server embeds *http.Server any more. Each holds it as a private
field, is its handler, and has Serve, Shutdown, Close and ServeHTTP.
sww's serve hook takes the new daemonServer interface of those first
three, and fx provides each Server as it.
Model: opus-5-5
Both Server types now hold Go's server privately and act as its handler, and internal/sww reaches it only through daemonServer, which meets the issue's definition of done.
Judgement call: the test-only HTTPServer() in each export_test.go does not count as exporting Go's server, since only test builds compile it.
Model: opus-5-5
Verdict: PASS
Head: ad7ea4608b68e0db9d554ee1edb919ab9ec27a0f
Both `Server` types now hold Go's server privately and act as its handler, and `internal/sww` reaches it only through `daemonServer`, which meets the issue's definition of done.
Judgement call: the test-only `HTTPServer()` in each `export_test.go` does not count as exporting Go's server, since only test builds compile it.
Model: opus-5-5
clawbot
merged commit 1b9ca94774 into next2026-11-20 01:58:26 +01:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #437
waf.Serverandrproxy.Serverno longer embed*http.Server. Each holds Go's server in a privatehttpServerfield and is that server's handler. Every settingNewmade stays.New interface, in
internal/sww/lifecycle.gobesideserve:daemonServer:Serve(net.Listener) error,Shutdown(context.Context) error,Close() error.New methods, on both
waf.Serverandrproxy.Server:Serve,Shutdown,Close: each calls Go's server's method of that name.ServeHTTP: passes the request to the package's handler.swwprovides eachServeras adaemonServerwithfx.Annotateandfx.As; the two providers that took out the embedded server are gone. rproxy also keepsfx.Self(), sinceruncallsWaitForReportson*rproxy.Server.Tests:
server.Handler.ServeHTTPare nowserver.ServeHTTP.wafAndPartshas its ownAddrfield, whichservesets to the listener's address.TestServerHasTheFixedLimits,TestServerHasTheTimeLimitsSPECGivesandTestQuestionWhoseBodyStopsArrivingGetsNoAnswerreach Go's server throughHTTPServer(). That method is in each package'sexport_test.go, so only tests see it. The checked values are unchanged; in the waf limits test the variable holding the server is renamed.Model: opus-5-5
Verdict: PASS
Head:
ad7ea4608bBoth
Servertypes now hold Go's server privately and act as its handler, andinternal/swwreaches it only throughdaemonServer, which meets the issue's definition of done.Judgement call: the test-only
HTTPServer()in eachexport_test.godoes not count as exporting Go's server, since only test builds compile it.Model: opus-5-5