Conversation
`DefaultRootObject` was parsed onto the model and never read, so a viewer request for the distribution root reached the origin as `/`. Against an S3 origin that returns the bucket's `ListBucketResult` XML instead of the SPA shell. Resolve it alongside the cache behavior and fetch it in place of the root path, preserving the query string. AWS applies the default root object to the distribution root ONLY, so a subdirectory request is never rewritten to `<dir>/<object>`; a blank config value is ignored and a stray leading slash is normalized rather than proxied as `//index.html`.
Sorttech
force-pushed
the
fix/cloudfront-default-root-object
branch
from
September 24, 2026 16:14
42ff1a3 to
72a401e
Compare
Owner
Author
|
Retargeted upstream as faiscadev#2560. |
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.
DefaultRootObjectwas parsed onto the model and never read, so a viewerrequest for the distribution root reached the origin as
/. Against an S3origin that returns the bucket's
ListBucketResultXML instead of the SPAshell.
Resolve it alongside the cache behavior and fetch it in place of the root
path, preserving the query string. AWS applies the default root object to
the distribution root ONLY, so a subdirectory request is never rewritten to
<dir>/<object>; a blank config value is ignored and a stray leading slashis normalized rather than proxied as
//index.html.Test plan
Regression test:
serves_default_root_object_at_the_distribution_rootincrates/fakecloud-e2e/tests/cloudfront_dataplane.rsVerification
On this exact head, rebased onto current
main:cargo fmt --all --check- clean.cargo clippy --workspace --all-targets -- -D warnings- clean.cargo test --workspaceexcludingfakecloud-e2e,fakecloud-conformance,fakecloud-tfaccandfakecloud-parity(the same set CI'stestjob runs),plus
cargo test -p fakecloud-conformance --lib- 9838 passed, 0 failed(
--no-fail-fast,--test-threads=4). An earlier run of the same commandfailed once in
fakecloud-ssm(
service::tests::rearm_in_flight_commands_settles_restored_pending) andpassed on rerun. That test reads the last durable snapshot right after the
in-memory status flips to
Successwhile the save is asynchronous; it fails4 of 11 runs on untouched
mainon this machine. This branch does not touchSSM.
cargo test -p fakecloud-e2e --test cloudfront_dataplane- the regressiontest above passes against a freshly built
target/debug/fakecloud.Found by deploying a CDK CloudFront + S3 SPA against fakecloud.