aocrunner icon indicating copy to clipboard operation
aocrunner copied to clipboard

Make solution URI-safe when sending to API

Open vegeta897 opened this issue 3 years ago • 1 comments

My correct solution for 2022 day 25 was failing when submitting through aocrunner. I know it was correct because submitting it manually on the website worked.

I suspect that the problem is that the solution isn't being URI encoded, and since the solution contained equals (=) characters, the answer was not properly received at the API end.

This PR simply wraps the solution in encodeURIComponent() in the body of the POST fetch.

I haven't confirmed that this is the reason it was rejecting my correct answer, but the solution should be URI encoded regardless.

vegeta897 avatar Dec 25 '22 07:12 vegeta897

Thanks! I had the same issue.

MartijnKooij avatar Dec 25 '22 11:12 MartijnKooij