Sanitize paths ending in / or ?. Fixes GH-353

I noticed that the util.sanitizePath method was no longer getting applied to the request path. This patch simply adds `?` sanitization and applies the dormant functionality to the request.getPath method.