Replace spaces in path only – not query string!

This leaves %20s in the query string in tact.

Agree this definitely needs a test! Maybe don’t merge this until we’ve got one, as tests are lagging behind a bit!