i also get a 404 when doing the encode twice from the JS lib, if i only encode once, i get that bad request error and also a CORS error
what happens with curl?