meros: Unable to parse json with boundary symbols in the response
Iβm using meros with relay for the @defer feature and by a coincidence we got exactly --- symbols in a particular field of received json, which leads to a parse error, because part.json is false.
Of course we can just remove these symbols from the data, but maybe there is a better way to handle it in the library?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 20 (12 by maintainers)
Commits related to this issue
- fix: allow boundary characters exist in the payloads resolves #13 — committed to maraisr/meros by maraisr 3 years ago
- fix: allow boundary characters exist in the payloads resolves #13 — committed to maraisr/meros by maraisr 3 years ago
- fix: allow boundary characters exist in the payloads resolves #13 — committed to maraisr/meros by maraisr 3 years ago
Ive released 1.2.0 as stable π, that contains the fixes outlined in this chatter. Hopefully that lines it up with our MS/C# is composing messages.
You shouldnt worry about that, if you JSON encode you will never collide with a boundary coz
\r\n---\r\nis encoded away with json, like'"\\r\\n---\\r\\n"'(note the double slashes)Thank you so much!! ππ»
Ill check this asap, it is Christmas and have a stack of life events to attend this next few days, but 100% will check/fix this before the new year.
@maraisr here is the example quite similar to our app https://github.com/ch1ffa/react-location-relay
There is one
@deferfragment which works on the version1.1.4, and if you change bio to---and reload the page, you can see an error. For the version1.2.0-next.3no data is shown because the first part in parts is missingUnfortunately, the same behaviour as for the custom build. The first part I see in a loop
part of partsis the second chunk that contains βlabelβ. Maybe I should create an example to reproduce both issues@maraisr Yeah, sure, let me check. And thank you for such a quick response!
Small update, was able to reproduce the bug with your example! ππ» working on a solution.
Hi @maraisr
Indeed, itβs from HC backend.
Our message contains something like that: