Skip to content

Commit 64eec9f

Browse files
committed
fix(router): remove originAccessControlConfig for HTTP origins to prevent 502
When router.route() receives an http:// URL, the CloudFront Function deletes customOriginConfig to inherit the placeholder's http-only config. However, the remaining originAccessControlConfig: { enabled: false } prevents CloudFront from correctly inheriting, causing it to default to HTTPS:443 — which fails with 502 if the origin only listens on HTTP:80. Fix: also delete originAccessControlConfig when protocol is "http". The override.originAccessControlConfig check below still allows OAC-enabled origins (protection: "oac") to re-add it explicitly. Fixes #6742 Made-with: Cursor
1 parent cc28fae commit 64eec9f

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

platform/src/components/aws/router.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2966,6 +2966,7 @@ function setUrlOrigin(urlHost, override) {
29662966
override = override ?? {};
29672967
if (override.protocol === "http") {
29682968
delete origin.customOriginConfig;
2969+
delete origin.originAccessControlConfig;
29692970
}
29702971
if (override.connectionAttempts) {
29712972
origin.connectionAttempts = override.connectionAttempts;

0 commit comments

Comments
 (0)