Fixed bug where JSON requests with %2f at the end would be redirected, resulting in HTML being sent to code expecting JSON