Handle upstreams without a trailing slash

Currently the proxy does not work when the upstream doesn't contain a trailing slash. This commit should fix this.