Skip to content

Commit

Permalink
scripts: set correct content-type when uploading image (#47263)
Browse files Browse the repository at this point in the history
* scripts: set correct content-type when uploading image

* chore: update
  • Loading branch information
vagusX committed Jan 31, 2024
1 parent f1f4788 commit 057e81f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/visual-regression/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ async function uploadFile(client, filePath, refValue) {
// https://help.aliyun.com/zh/oss/developer-reference/prevent-objects-from-being-overwritten-by-objects-that-have-the-same-names-3
'x-oss-forbid-overwrite': 'false',
};
// Set content-type to allow individual preview of images
if (path.extname(filePath) === '.png') {
headers['Content-Type'] = 'image/png';
}

console.log('Uploading file: %s', filePath);
try {
Expand Down

0 comments on commit 057e81f

Please sign in to comment.