Use url to parse req.url

`req.pathname` is not supported in connect. Other than this, the rewritten middleware still supports connect so it would be great to have this change.