caderek / aocrunner

Advent of Code runner
ISC License
163 stars 23 forks source link

Make solution URI-safe when sending to API #28

Open vegeta897 opened 1 year ago

vegeta897 commented 1 year ago

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.

MartijnKooij commented 1 year ago

Thanks! I had the same issue.