proxy plugin: Updated request URL encoding to handle malformed URLs

[Closes #392]