Skip to content

Commit b65aa7b

Browse files
authored
Merge pull request #56 from modelcontextprotocol/ochafik/pdf-js-inflate
Decompress PDF images in JavaScript
2 parents 504b6f7 + 059d134 commit b65aa7b

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎src/modules/example-apps/index.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ import { createServer as createWikiExplorerServer } from '@modelcontextprotocol/
3838

3939
import { LAZY_AUTH_SLUG } from './lazy-auth.js';
4040

41+
// pdf.js inflates images with the native DecompressionStream, and falls back to
42+
// its own JavaScript inflate when that global is missing. Remove it so PDFs
43+
// from arbitrary URLs are only decompressed in JavaScript.
44+
Reflect.deleteProperty(globalThis, 'DecompressionStream');
45+
4146
declare module "express-serve-static-core" {
4247
interface Request {
4348
auth?: AuthInfo;

0 commit comments

Comments
 (0)