Rewriting response so that the location header is properly constructed.