Skip to content

Commit 572b513

Browse files
author
Keith R. Gustafson
committed
Set HTTP status 500 when site is unavailable
When the site is down, it shows an error message but the HTTP code is the default of 200. This is a problem for load balancers seeing the application as healthy when it is not.
1 parent e5d408f commit 572b513

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

gemini/src/main/java/com/techempower/gemini/GeminiApplication.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,6 +1139,7 @@ protected void handleRequest(Context context)
11391139
private void handleError(Context context, String error) throws IOException
11401140
{
11411141
context.setContentType("text/html");
1142+
context.setStatus(500);
11421143
final Writer writer = context.getWriter();
11431144
writer.write("<html>");
11441145
writer.write("<head><title>Temporarily Unavailable</title>");

0 commit comments

Comments
 (0)