Skip to content

Commit 73d4a4d

Browse files
committed
v0:contracts(pkg):fix: update Blob MIME type to include charset in read handler and contract validation
1 parent 7f6b9f9 commit 73d4a4d

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

apps/workers/v0/src/routers/read/read.handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const readGETHandler = authed
1919
);
2020

2121
// WORKAROUND: Return a Blob with text/markdown MIME type to bypass ORPC's JSON serialization
22-
return new Blob([result], { type: 'text/markdown' });
22+
return new Blob([result], { type: 'text/markdown; charset=utf-8' });
2323
} catch (error) {
2424
const errorMessage =
2525
error instanceof Error ? error.message : 'Unknown error';

packages/contracts/src/read.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ export const readGETContract = readOC
2929
.output(
3030
z
3131
.instanceof(Blob)
32-
.refine((blob) => blob.type === 'text/markdown', {
33-
message: 'Blob must have text/markdown MIME type',
32+
.refine((blob) => blob.type === 'text/markdown; charset=utf-8', {
33+
message: 'Blob must have text/markdown; charset=utf-8 MIME type',
3434
})
3535
.meta({
3636
description: 'The page markdown content',

0 commit comments

Comments
 (0)