You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It assumes that any content can be encoded as base64 and if so it will convert it before saving. and four letter words can be base64 format.
If I replace test with dGVzdA== then the file contains the text "test".
If I replace test with YWFh then the file contains "aaa".
Additional remarks
When I did some testing using javascripts atob and btoa I noticed that I could convert it back and forth. Originally I assumed that the word "test" had a special meaning 😄
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as pinned, good first issue, help wanted or triaged/resolved. Thank you for your contributions.
Expected Behavior
When invoking
create
onlocalstorage
withtest
I expect that the new file has 4 bytes which spell out "test".Actual Behavior
The actual content of the file is 3 bytes
0xb5 0xeb 0x2d
.Steps to Reproduce the Problem
Invoke the following.
Example taken from: https://docs.dapr.io/reference/components-reference/supported-bindings/localstorage/#create-file but with the data being replaced with "test"
Cause
Since other words like "hello" worked fine I did some additional research. The problem is this line https://github.com/dapr/components-contrib/blob/cfee998aba0817ae07dc31bb53c34d21f6b9f4f2/bindings/localstorage/localstorage.go#L172C1-L175C3
It assumes that any content can be encoded as base64 and if so it will convert it before saving. and four letter words can be base64 format.
If I replace
test
withdGVzdA==
then the file contains the text "test".If I replace
test
withYWFh
then the file contains "aaa".Additional remarks
When I did some testing using javascripts
atob
andbtoa
I noticed that I could convert it back and forth. Originally I assumed that the word "test" had a special meaning 😄The text was updated successfully, but these errors were encountered: