Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GET return corrupted binary files #14

Closed
newbaluku opened this issue Apr 14, 2022 · 7 comments
Closed

GET return corrupted binary files #14

newbaluku opened this issue Apr 14, 2022 · 7 comments

Comments

@newbaluku
Copy link

newbaluku commented Apr 14, 2022

when trying to return a binary file (20KB) to the caller. Caller side received corrupted binary file (35KB).
test-fc-http.zip

can be repro using attached modified sample project. under GET /file/:filepath endpoint.

to repro, try calling GET /file/data.jpg
the return image file becomes invalid.

no problem when returning text files.

have tried to set the binary flag as such, but none of the suggested options solve the above issue.

// option 1:
exports.handler = serverless(app);

// option 2:
exports.handler = serverless(app, {
  binary: false     // true / false doesn't matter, problem still exists
});

// option 3:
exports.handler = serverless(app, {
  binary: ['image/*', 'application/octet-stream']
});
@newbaluku
Copy link
Author

?

@heimanba
Copy link
Member

?

已经找到方案哈,预计今天,最迟明天发布新版本哈

@heimanba
Copy link
Member

heimanba commented Apr 20, 2022

?

Thank you for your patient support, the V1.0.1 version has been fixed

@newbaluku
Copy link
Author

?

Thank you for your patient support, the V1.0.1 version has been fixed

ok, will try it. Thanks.

@heimanba
Copy link
Member

?

Thank you for your patient support, the V1.0.1 version has been fixed

ok, will try it. Thanks.

hi,Does it work?

@newbaluku
Copy link
Author

Hi, the problem seems to be fixed.

will do more testing on other aspect.

Thanks @heimanba

@newbaluku
Copy link
Author

// option 1:
exports.handler = serverless(app);

// option 2:
exports.handler = serverless(app, {
binary: false // true / false doesn't matter, problem still exists
});

// option 3:
exports.handler = serverless(app, {
binary: ['image/*', 'application/octet-stream']
});

tested working with the following options:

// option 1:
exports.handler = serverless(app);

// option 2:
exports.handler = serverless(app, {
binary: ['application/octet-stream']
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants