From 62b4cbdc5731130f0983e315765fa99a2087600c Mon Sep 17 00:00:00 2001 From: DevSnaith <65865554+DevSnaith@users.noreply.github.com> Date: Wed, 19 Apr 2023 10:50:25 +0300 Subject: [PATCH] implements RequestHandler --- src/org/eu/lumiere/utils/SimpleResponse.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/org/eu/lumiere/utils/SimpleResponse.java b/src/org/eu/lumiere/utils/SimpleResponse.java index 2c71951..397f009 100644 --- a/src/org/eu/lumiere/utils/SimpleResponse.java +++ b/src/org/eu/lumiere/utils/SimpleResponse.java @@ -1,10 +1,12 @@ 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; +import java.net.Socket; -public class SimpleResponse implements HttpRequestHandler { +import org.eu.lumiere.net.RequestHandler; +import org.eu.lumiere.net.http.HTTPRequest; +import org.eu.lumiere.net.http.HTTPResponse; + +public class SimpleResponse implements RequestHandler { private String body = "BasicResponse is running"; private boolean html_response = false; @@ -15,7 +17,7 @@ public class SimpleResponse implements HttpRequestHandler { } @Override - public void onRequestReceived(HttpRequest request, HttpResponse response) { + public void onRequestReceived(Socket socket, HTTPRequest request, HTTPResponse response) { response.setContentType(String.format("text/%s", html_response ? "html" : "plan")); response.push(body); }