Skip to content

Commit

Permalink
complete
Browse files Browse the repository at this point in the history
  • Loading branch information
aleortega committed Oct 12, 2024
1 parent e5f4804 commit 4349511
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions content/src/controller/handlers/get-content-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { createContentFileHeaders } from '../utils'
// Method: GET or HEAD
export async function getContentHandler(context: HandlerContextWithPath<'storage', '/contents/:hashId'>) {
const shouldCalculateContentType = context.request.headers.get('Accept') === 'Any'
//url.searchParams.has('calculateContentType')
const hash = context.params.hashId

const content: ContentItem | undefined = await context.components.storage.retrieve(hash)
Expand All @@ -19,7 +18,7 @@ export async function getContentHandler(context: HandlerContextWithPath<'storage
status: 200,
headers: shouldCalculateContentType
? calculatedHeaders
: { ...calculatedHeaders, 'Content-Type': 'application/json' },
: { ...calculatedHeaders, 'Content-Type': 'application/octet-stream' },
body: context.request.method.toUpperCase() === 'GET' ? await content.asRawStream() : undefined
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ describe('Integration - Get wearable image and thumbnail', () => {

for (const response of responses) {
expect(response.status).toEqual(200)
expect(response.headers.get('content-type')).toEqual('image/png')
expect(response.headers.get('content-type')).toEqual('application/octet-stream')
expect(response.headers.get('ETag')).toBeTruthy()
expect(response.headers.get('Cache-Control')).toBeTruthy()
}
Expand Down

0 comments on commit 4349511

Please sign in to comment.