Skip to content

Drop connect and serve-static in favour of native http#170

Merged
soulgalore merged 1 commit into
mainfrom
drop-connect-serve-static
May 17, 2026
Merged

Drop connect and serve-static in favour of native http#170
soulgalore merged 1 commit into
mainfrom
drop-connect-serve-static

Conversation

@soulgalore
Copy link
Copy Markdown
Member

The test fixture web server only needs to map a request path to a file under
test/http-server and stream it back, optionally over http2 with the test
certs. A connect pipeline plus serve-static was overkill for that, and was
the last reason to depend on a connect middleware stack at all.

The replacement is a small handler in test/help/webserver.js: resolve the
request path against the fixture root with a normalise/traversal guard, look
up a MIME type by extension, pipe the file out. HTTP/2 still wires in the
same key/cert pair from test/testdata/certs. Probed against a representative
fixture: HTML, image, missing path, directory request — all behave the same
as before, with one fewer dependency chain dragged into the install.

Co-authored-by: Claude noreply@anthropic.com

  The test fixture web server only needs to map a request path to a file under
  test/http-server and stream it back, optionally over http2 with the test
  certs. A connect pipeline plus serve-static was overkill for that, and was
  the last reason to depend on a connect middleware stack at all.

  The replacement is a small handler in test/help/webserver.js: resolve the
  request path against the fixture root with a normalise/traversal guard, look
  up a MIME type by extension, pipe the file out. HTTP/2 still wires in the
  same key/cert pair from test/testdata/certs. Probed against a representative
  fixture: HTML, image, missing path, directory request — all behave the same
  as before, with one fewer dependency chain dragged into the install.

  Co-authored-by: Claude noreply@anthropic.com
@soulgalore soulgalore force-pushed the drop-connect-serve-static branch from 2baca24 to d28f6b7 Compare May 17, 2026 12:13
@soulgalore soulgalore merged commit ae997bd into main May 17, 2026
3 checks passed
@soulgalore soulgalore deleted the drop-connect-serve-static branch May 17, 2026 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant