mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
DefaultCacheBehavior and CacheBehavior each had their own ~250-line hand-written XML-parsing state machine for the same element shape, found via a CPD pass (#3652). Extracted the shared logic into one parseCacheBehaviorScope helper, used by both parsing call sites, with a small CacheBehaviorSettings interface so the helper can populate either model type. The duplication had already caused the exact bug it risked: the CacheBehavior copy never parsed RealtimeLogConfigArn, even though the field exists on both types in AWS's real CloudFront wire model and on the CacheBehavior model class itself. The response XML builders for both types also never emitted it. Fixed both and added a regression test.