SeanCassiere/nv-reservation-cc-update

Weird behaviours in the encoding of the base64 config

Closed this issue · 0 comments

Currently, the base64 encoding being done has some weird artefacts which are produced.

Take the string below, it produces a weird 7 being appended into the newly decoded string;

Encoded ->

eyJjbGllbnRJZCI6NjA1LCJlbWFpbFRlbXBsYXRlSWQiOjEwNTcyLCJmbG93IjpbIlJlbnRhbFNpZ25hdHVyZUZvcm0iXSwiZnJvbVJlbnRhbGwiOnRydWUsInN1Y2Nlc3NTdWJtaXNzaW9uU2NyZWVuIjoiU3VjY2Vzc1N1Ym1pc3Npb24iLCJzaG93UHJlU3VibWl0U3VtbWFyeSI6dHJ1ZX0%3D

Decoded ->

{"clientId":605,"emailTemplateId":10572,"flow":["RentalSignatureForm"],"fromRentall":true,"successSubmissionScreen":"SuccessSubmission","showPreSubmitSummary":true}7

This is weird since this is not valid JSON. However, the application's decoder function seems to be able to handle this and work fine.

Just, want to remove this weird artifact that produces base64 string of proper JSON parseable objects.