Skip to content

Commit 8729917

Browse files
committed
Correct status endpoint with 3xx codes
1 parent 95d2385 commit 8729917

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/main/java/org/gaul/httpbin/HttpBinHandler.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ public void handle(String target, Request baseRequest,
6363
int status = Integer.parseInt(uri.substring(
6464
"/status/".length()));
6565
servletResponse.setStatus(status);
66+
if (status >= 300 && status < 400) {
67+
servletResponse.setHeader("Location", "/redirect/1");
68+
}
6669
baseRequest.setHandled(true);
6770
return;
6871
} else if (method.equals("GET") && uri.equals("/headers")) {

0 commit comments

Comments
 (0)