Skip to content

Commit

Permalink
fix: encoding issue in CDN responses (#2130)
Browse files Browse the repository at this point in the history
When downloading the redoc JS from redoc.ly CDN (e.g.
https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js) the
Content-Type header in the response is missing 'charset=utf-8', causing
the file to be displayed with garbled characters.
  • Loading branch information
bparmentier authored Aug 18, 2022
1 parent efd5e09 commit 7816902
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/publish-cdn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ VERSION=$(node scripts/version.js)
VERSION_TAG=v${VERSION:0:1}.x

copy_to_s3 () {
aws s3 cp bundles "s3://redocly-cdn/redoc/$1/bundles" --recursive
aws s3 cp --exclude "*" --include "*.js" --content-type "application/javascript; charset=utf-8" bundles "s3://redocly-cdn/redoc/$1/bundles" --recursive
aws s3 cp --exclude "*" --include "*.map" --content-type "application/json" bundles "s3://redocly-cdn/redoc/$1/bundles" --recursive
aws s3 cp --exclude "*" --include "*.txt" bundles "s3://redocly-cdn/redoc/$1/bundles" --recursive
aws s3 cp CHANGELOG.md "s3://redocly-cdn/redoc/$1/CHANGELOG.md"
aws s3 cp LICENSE "s3://redocly-cdn/redoc/$1/LICENSE"
aws s3 cp package.json "s3://redocly-cdn/redoc/$1/package.json"
Expand Down

0 comments on commit 7816902

Please sign in to comment.