Percent decode url before percent-encoding it.

There seems to be a bug where "special characters" in the request URL (the part before the query string) get double-percent-encoded. This patch causes them to be encoded only once.