-
Notifications
You must be signed in to change notification settings - Fork 119
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
_HeadersCommonKt.headersCheckValue caused by IllegalArgumentException - Unexpected char <address> at 45 in x-amz-meta-text #2657
Comments
Another cause for statistics: |
@yaroslav-v Thank you for the detailed explanation. One of the members on our team will be taking a look. |
@yaroslav-v This is coming from OkHttp. OkHttp does not allow non ASCII characters in headers by default. See (square/okhttp#2016) and the workaround while generating OkHttp requests (https://square.github.io/okhttp/5.x/okhttp/okhttp3/-headers/-builder/add-unsafe-non-ascii.html). I'll have to look at our V1 dependencies to see why v1 would possibly be working here. However, I do not believe the issue here is with the "key" being provided, but additional headers you may be passing that are not shown in the snippet? Are you adding "x-amz-meta-text" and "x-amz-meta-name" headers yourself? I do not see us adding these. If possible, using only ASCII characters would allow the upload to suceed. I'll continue to look into how this was working in v1. |
@yaroslav-v After further research on v1, a non-ascii header name will cause a failure but non-ascii header value works. |
Hi! Thx for the answer. Well, in some cases we add a couple of additional values from users to the metadata array (check the code snippet): So, probably, this is the source of the data, but we don't add any headers directly. |
@yaroslav-v We believe Amplify v2.14.10 fixes this issue, as the underlying AWS Kotlin SDK was updated to include the fix. |
Thx, will test |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Before opening, please confirm:
Language and Async Model
Java
Amplify Categories
Storage
Gradle script dependencies
Environment information
Please include any relevant guides or documentation you're referencing
No response
Describe the bug
Hi there!
A part of our users experience issues with uploading images to AWS. The issue appears on all Android version from 10 to 14, affected devices include Samsung, Motorola, Oneplus, Google.
As far as I can see, the file name might contain some emoji symbols. For example:
Caused by java.lang.IllegalArgumentException
Unexpected char 0xd83d at 0 in x-amz-meta-text value: 😏
or
Caused by java.lang.IllegalArgumentException
Unexpected char 0xd83e at 6 in x-amz-meta-name value: hayden🩷
etc.
You can find a crashlog from Firebase in the attachment.
Previously, we've used AWS Amplify v1.x and there were no such issues. So, I'm not sure what's correct way to handle this issue. Should it be handled by Amplify SDK or you have some recommendations for the data?
Reproduction steps (if applicable)
No response
Code Snippet
Log output
amplifyconfiguration.json
No response
GraphQL Schema
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: