Skip to content

Commit c57672a

Browse files
committed
Fix headers for some errors
1 parent a236077 commit c57672a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/pw/chew/jsonrestapi/RestServer.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ private String buildResponse(String method, String route, Map<String, String> pa
240240
* @param writer The {@link PrintWriter} to print the response to.
241241
*/
242242
private void respondNotAllowed(PrintWriter writer) {
243-
writer.print("HTTP/1.2 405 Not Allowed\n\n"
243+
writer.print("HTTP/1.2 405 Not Allowed\n"
244244
+ "Content-Type: application/json; charset=utf-8\n"
245245
+ "\n"
246246
+ "{\"success\": false}");
@@ -252,7 +252,7 @@ private void respondNotAllowed(PrintWriter writer) {
252252
* @param writer The {@link PrintWriter} to print the response to.
253253
*/
254254
private void respondBadRequest(PrintWriter writer) {
255-
writer.print("HTTP/1.2 400 Bad Request\n\n"
255+
writer.print("HTTP/1.2 400 Bad Request\n"
256256
+ "Content-Type: application/json; charset=utf-8\n"
257257
+ "\n"
258258
+ "{\"success\": false}");
@@ -264,7 +264,7 @@ private void respondBadRequest(PrintWriter writer) {
264264
* @param writer The {@link PrintWriter} to print the response to.
265265
*/
266266
private void respondNotFound(PrintWriter writer) {
267-
writer.print("HTTP/1.2 404 Not Found\n\n"
267+
writer.print("HTTP/1.2 404 Not Found\n"
268268
+ "Content-Type: application/json; charset=utf-8\n"
269269
+ "\n"
270270
+ "{\"success\": false}");

0 commit comments

Comments
 (0)