mirror of
https://github.com/directus/directus.git
synced 2026-01-28 16:48:02 -05:00
Fix azure storage content-type (#8294)
* fix azure storage content-type * Use ?? instead of || Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
This commit is contained in:
@@ -213,14 +213,20 @@ export class AzureBlobWebServicesStorage extends Storage {
|
||||
return { raw: result };
|
||||
}
|
||||
|
||||
public async put(location: string, content: Buffer | NodeJS.ReadableStream | string): Promise<Response> {
|
||||
public async put(
|
||||
location: string,
|
||||
content: Buffer | NodeJS.ReadableStream | string,
|
||||
type?: string
|
||||
): Promise<Response> {
|
||||
location = this._fullPath(location);
|
||||
|
||||
const blockBlobClient = this.$containerClient.getBlockBlobClient(location);
|
||||
|
||||
try {
|
||||
if (isReadableStream(content)) {
|
||||
const result = await blockBlobClient.uploadStream(content as Readable);
|
||||
const result = await blockBlobClient.uploadStream(content as Readable, undefined, undefined, {
|
||||
blobHTTPHeaders: { blobContentType: type ?? 'application/octet-stream' },
|
||||
});
|
||||
return { raw: result };
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user