Skip to content

Commit 32f7906

Browse files
committed
fix: fix storage file download
1 parent 6eddc53 commit 32f7906

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

lib/app/components/storage/storage.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -444,19 +444,22 @@ export default class Storage {
444444
location = file.location,
445445
bucket = location.bucket;
446446

447-
if ( cacheControl === undefined ) cacheControl = location.cacheControl;
448-
if ( cacheControl ) headers[ "cache-control" ] = cacheControl;
447+
if ( contentType ) {
448+
headers[ "content-type" ] = contentType;
449+
}
449450

450-
if ( contentType ) headers[ "content-type" ] = contentType;
451+
if ( cacheControl === undefined ) {
452+
if ( file.cacheControl == null ) {
453+
headers[ "cache-control" ] = location.cacheControl;
454+
}
455+
}
456+
else {
457+
headers[ "cache-control" ] = cacheControl;
458+
}
451459

452460
if ( contentDisposition ) {
453461
headers[ "content-disposition" ] = contentDisposition;
454462
}
455-
else {
456-
headers[ "content-disposition" ] = {
457-
"filename": file.name,
458-
};
459-
}
460463

461464
message = new Message( {
462465
"headers": headers,

0 commit comments

Comments
 (0)