Repository navigation
Serve site:run with the JDK HTTP server instead of Jetty 9 - #1303
Merged
Merged
Conversation
Jetty 9 is end of life: 9.4.58.v20250814 is the last release and future CVEs in it will not be fixed publicly. site:run only needs to serve a directory and render documents on request, which the JDK built-in com.sun.net.httpserver.HttpServer covers, so the Java 8 baseline is kept and the whole Jetty dependency tree leaves the pom. The test DAV/proxy servers are ported to the JDK HTTP server as well, which also drops javax.servlet-api. Fixes #1298
|
@slachiewicz The PR can't be associated to a milestone, because there are multiple open milestones. Please add the text "branch: master" to the description to the milestone where this PR belongs to. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1298. Estate-wide context: apache/maven#12768.
What and why
site:runembedded Jetty 9.4 at compile scope. 9.4.58.v20250814 is the last release of the 9.4 line — no version bump is possible and future CVEs in it will not be fixed publicly (jetty/jetty.project#13918).site:runneeds two things: serve a directory, and route document requests through the render-on-request loop.com.sun.net.httpserver.HttpServer(in the JDK since 6,jdk.httpservermodule since 9) covers both, so this PR:DoxiaFilter(servletFilter) withDoxiaHandler(HttpHandler) — same locale routing, welcome-file handling and external-report serving, plus path-traversal protection that the servlet container used to provideSiteRunMojoon the JDK HTTP server (daemon executor, shutdown hook,port=0supported as before)SimpleDavServerHandler) to the JDK HTTP server and merges theAuthAsyncProxyServletproxy-auth gate into it (BasicProxy-Authorization, 407 on failure) — no test ever used Jetty's actual forwarding pathjavax.servlet-apiand thejettyVersionproperty from the pomWEB-INF/web.xmldummy webapp andWebXmlTestThe Java 8 baseline is unchanged (option 2 — Jetty 12 — would have required 17).
Behavior notes
charsetfrom the site's output encoding (previously the servlet container's default).304/If-Modified-Sincehandling and no directory listings — both irrelevant for a loopback dev-preview server.Verification
mvn verifygreen, 3/3 tests (both WebDAV deploy tests, incl. the proxy-auth 407 flow).PUT http://toto.com/... HTTP/1.1) as sent through a proxy./renders on demand (200 text/html; charset=UTF-8), skin css/png served with correct content types, unknown paths 404, and both/../and%2e%2e/traversal attempts blocked.