Edit the name from Basic to SimpleResponse

This commit is contained in:
DevSnaith 2023-04-14 01:36:38 +03:00
parent ad5757faae
commit 231830b6b4
2 changed files with 0 additions and 23 deletions

View File

@ -1,23 +0,0 @@
package org.eu.lumiere.utils;
import org.eu.lumiere.net.http.HttpRequest;
import org.eu.lumiere.net.http.HttpRequestHandler;
import org.eu.lumiere.net.http.HttpResponse;
public class BasicResponse implements HttpRequestHandler {
private String body = "BasicResponse is running";
private boolean html_response = false;
public BasicResponse(String body, boolean rhtml) {
this.body = body == null ? this.body : body;
this.html_response = rhtml;
}
@Override
public void onRequestReceived(HttpRequest request, HttpResponse response) {
response.setContentType(String.format("text/%s", html_response ? "html" : "plan"));
response.push(body);
}
}