Dispatch /dims3/ on the handler - #122
Merged
Merged
Conversation
dims_handler matched the /dims3/ URI as well as the handler name, so the module served the path on any server that loaded it. Removing the <Location /dims3/> block left the endpoint serving, and so did SetHandler None. The URI test is gone. Both legacy endpoints now dispatch on the handler name, as /dims5/ and dims-status already do. The container image drives each SetHandler from the environment. DIMS_ENABLE_DIMS3 defaults to off and DIMS_ENABLE_DIMS4 defaults to on.
beetlebugorg
force-pushed
the
feat/toggle-legacy-endpoints
branch
from
September 1, 2026 11:13
97de3cf to
98336c0
Compare
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.
What
dims_handlerdispatches/dims3/on the handler name. The container image sets each legacy handler from the environment:DIMS_ENABLE_DIMS3defaults to off,DIMS_ENABLE_DIMS4defaults to on.Why
The dispatch matched the URI as well as the handler name:
That test ran before any handler check, so the module responded to a
/dims3/request on any server that loaded it. I removed the<Location /dims3/>block from the running image and requested the path: the module responded with 500 from its own allowlist check.SetHandler Nonegave the same result. An operator had no way to stop serving/dims3/short of unloading the module./dims4/,/dims5/, anddims-statusdispatch on the handler name./dims3/now does the same.Verify
281 cases pass, 105 sanitizer cases report no finding, and every golden file reproduces.
TestDims3HandlerRemovedandTestDims4HandlerRemovedrequest both paths on a server that setsSetHandler None, and expect 404.TestLegacyEndpointsServedWhereConfiguredrequests them on the default server and expects a status other than 404.Against the built image:
I measured 404 with the image defaults and 500 with
-e DIMS_ENABLE_DIMS3=on. The same run with-e DIMS_ENABLE_DIMS4=offreturned 404 for/dims4/.Breaking
A server that loads the module and has no
<Location /dims3/>block stops serving/dims3/. A server whose configuration sets the handler is unaffected.The image stops serving
/dims3/unlessDIMS_ENABLE_DIMS3is on. A deployment that uses/dims3/through the image sets it.