Skip to content

feat: Replace specHandler with streaming resourceHandler#84

Merged
thced merged 1 commit into
masterfrom
feat/resource-handler
May 20, 2026
Merged

feat: Replace specHandler with streaming resourceHandler#84
thced merged 1 commit into
masterfrom
feat/resource-handler

Conversation

@thced

@thced thced commented May 20, 2026

Copy link
Copy Markdown
Contributor

Adds Handlers.resourceHandler(String) and Handlers.resourceHandler(Path) that stream from classpath or filesystem with handler-owned stream lifecycle. Existence and length are resolved at construction; the underlying stream is opened and closed per request, avoiding the try-with-resources-closes-too-early trap with lazy Response.stream writers.

Replaces the eager byte-buffering specHandler and removes the internal ClasspathResourceHandler. Content-Type inference now also covers .html, .css, and .js.

Adds Handlers.resourceHandler(String) and Handlers.resourceHandler(Path)
that stream from classpath or filesystem with handler-owned stream
lifecycle. Existence and length are resolved at construction; the
underlying stream is opened and closed per request, avoiding the
try-with-resources-closes-too-early trap with lazy Response.stream
writers.

Replaces the eager byte-buffering specHandler and removes the internal
ClasspathResourceHandler. Content-Type inference now also covers .html,
.css, and .js.
@sonarqubecloud

Copy link
Copy Markdown

@thced thced merged commit d613f05 into master May 20, 2026
5 checks passed
@thced thced deleted the feat/resource-handler branch May 20, 2026 14:35
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.

2 participants