[dart2] [client] Check request .bodyBytes, not .body#17809
Open
0xNF wants to merge 1 commit intoOpenAPITools:masterfrom
Open
[dart2] [client] Check request .bodyBytes, not .body#178090xNF wants to merge 1 commit intoOpenAPITools:masterfrom
0xNF wants to merge 1 commit intoOpenAPITools:masterfrom
Conversation
…e.bodyBytes.isEmpty because .body implicitly converts to a utf-8 string which is will cause crashes when the data isnt utf-8 (OpenAPITools#17546)
Contributor
|
How a byte array isn't a valid utf8 string(?)? |
5 tasks
Contributor
|
No matching octet sequence or just unknown/invalid unicode. |
Contributor
Author
For example, an endpoint that returns the bytes of a jpeg. In my case it was image data that caused exceptions, but endpoints can serve any encoding of byte, and every encoding is not valid utf8. |
Member
|
for testing, we can consider adding echo api client for dart. We already have an endpoint to return a gif, we can create another endpoint to return a utf6 string. @0xNF ping me if you need help adding the Dart echo api client to perform integration tests. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix #17546
This PR is part of the effort to split PR #17548
Changes request parsing from checking
.body.isNotEmptyto.bodyBytes.isNotEmpty, because .body implicitly converts to a utf-8 string, and will crash when trying to deserde data that isn't valid utf-8.@jaumard (2018/09) @josh-burton (2019/12) @amondnet (2019/12) @sbu-WBT (2020/12) @kuhnroyal (2020/12) @agilob (2020/12) @ahmednfwela (2021/08)