Skip to content

Commit 7816902

Browse files
authored
fix: encoding issue in CDN responses (Redocly#2130)
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.
1 parent efd5e09 commit 7816902

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

scripts/publish-cdn.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ VERSION=$(node scripts/version.js)
88
VERSION_TAG=v${VERSION:0:1}.x
99

1010
copy_to_s3 () {
11-
aws s3 cp bundles "s3://redocly-cdn/redoc/$1/bundles" --recursive
11+
aws s3 cp --exclude "*" --include "*.js" --content-type "application/javascript; charset=utf-8" bundles "s3://redocly-cdn/redoc/$1/bundles" --recursive
12+
aws s3 cp --exclude "*" --include "*.map" --content-type "application/json" bundles "s3://redocly-cdn/redoc/$1/bundles" --recursive
13+
aws s3 cp --exclude "*" --include "*.txt" bundles "s3://redocly-cdn/redoc/$1/bundles" --recursive
1214
aws s3 cp CHANGELOG.md "s3://redocly-cdn/redoc/$1/CHANGELOG.md"
1315
aws s3 cp LICENSE "s3://redocly-cdn/redoc/$1/LICENSE"
1416
aws s3 cp package.json "s3://redocly-cdn/redoc/$1/package.json"

0 commit comments

Comments
 (0)