MockServerHost serverHost = (MockServerHost) requestHost;
MockServerResponse serverResponse = serverHost.process(request);
MockHttpServletResponse response = (MockHttpServletResponse) serverResponse.getResponse();
for (Cookie cookie : response.getCookies()) cookies.put(cookie.getName(), cookie);
int code = response.getIntHeader("Status");
switch (code) {
case 200: case -1: return new MockBrowserResponse(serverResponse, request);
case 301: case 302: case 303: case 304: case 305: case 306: case 307:
return this.process(new MockBrowserRequest(new URL(request.getUrl(), response.getHeader("Location")), "GET"));
default:
throw new MockBrowserHttpErrorException(request, code, null, null);
}
} catch (Exception e) {