Skip to content

Commit

Permalink
Update minio-files-service.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
jlarsson committed Sep 27, 2023
1 parent 29bb2e1 commit 0f365e3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/files/minio-files-service/minio-files-service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Client } from 'minio'
import type { ApplicationModule } from '@helsingborg-stad/gdi-api-node'
import mime from 'mime-types'
import type { FilesService } from '../types'
import { generateFileId, tryConvertDataUriToImageBuffer } from '../utils'

Expand Down Expand Up @@ -91,6 +92,7 @@ class MinioFilesService implements FilesService {
try {
const client = this.createMinioClient()
const stream = await client.getObject(this.config.bucket, fileId)
ctx.type = mime.lookup(fileId) || 'application/octet-stream'
ctx.body = stream
} catch {
// unfortunately, send() exposes to much info on errors
Expand Down

0 comments on commit 0f365e3

Please sign in to comment.