Skip to content

Commit

Permalink
Fix static assets returning 400 error in integration
Browse files Browse the repository at this point in the history
Description:
- As part of #73 Fastly now talks directly to S3 to serve up static assets
- However in the integration environment the `Authorization: Basic xxx` header is set which Fastly sends along to S3 causing S3 to incorrectly interpret it as an authorization request. This causes a 400 error to return for the static assets
- Following unsets the header so Fastly can correctly send a non-authorized GET request to S3 to retrieve the object and resolve this error
  • Loading branch information
nimalank7 committed Jul 16, 2024
1 parent 44a43ca commit e1d202e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/www/www.vcl.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,9 @@ sub vcl_recv {
set req.backend = F_staticAssetsS3;
set req.http.host = "${s3_static_assets_hostname}";
set req.http.Fastly-Backend-Name = "staticAssetsS3";
%{ if basic_authentication != null ~}
unset req.http.Authorization;
%{ endif ~}
}

return(lookup);
Expand Down

0 comments on commit e1d202e

Please sign in to comment.