Skip to content

Commit 833e153

Browse files
authored
Merge pull request #1 from TarasZakus/TarasZakus-patch-1
Fix inline file upload
2 parents c233a0f + 53e4fad commit 833e153

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/apiGateway.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,12 @@ export function httpRequestToEvent(request: Request): APIGatewayProxyEventV2 {
3535
);
3636

3737
const bodyString = Buffer.isBuffer(request.body) ? request.body.toString('utf8') : '';
38-
const shouldSendBase64 = request.method === 'GET' ? false : bodyString.includes('Content-Disposition: form-data');
38+
const shouldSendBase64 = request.method === 'GET'
39+
? false
40+
: (
41+
bodyString.includes('Content-Disposition: form-data') ||
42+
(headers['content-disposition']?.startsWith('inline;') === true)
43+
);
3944

4045
const cookies = request.headers.cookie ? request.headers.cookie.split('; ') : [];
4146

0 commit comments

Comments
 (0)