fix: encoding issue in CDN responses (#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.
This commit is contained in:
Bruno Parmentier 2022-08-18 14:42:57 +02:00 committed by GitHub
parent efd5e09c90
commit 781690284a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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"