Skip to content

Commit 5b1047f

Browse files
committed
refactor servlert fix #182
1 parent 039176c commit 5b1047f

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed
Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,16 @@
11
package graphql.servlet;
22

3-
import java.util.function.BiConsumer;
43
import javax.servlet.http.HttpServletRequest;
54
import javax.servlet.http.HttpServletResponse;
65

7-
interface HttpRequestHandler extends BiConsumer<HttpServletRequest, HttpServletResponse> {
6+
interface HttpRequestHandler {
87

98
String APPLICATION_JSON_UTF8 = "application/json;charset=UTF-8";
109
String APPLICATION_EVENT_STREAM_UTF8 = "text/event-stream;charset=UTF-8";
1110
String APPLICATION_GRAPHQL = "application/graphql";
1211
int STATUS_OK = 200;
1312
int STATUS_BAD_REQUEST = 400;
1413

15-
@Override
16-
default void accept(HttpServletRequest request, HttpServletResponse response) {
17-
try {
18-
handle(request, response);
19-
} catch (Exception e) {
20-
throw new RuntimeException(e);
21-
}
22-
}
23-
2414
void handle(HttpServletRequest request, HttpServletResponse response) throws Exception;
2515

2616
}

src/main/java/graphql/servlet/HttpRequestHandlerImpl.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import graphql.servlet.input.GraphQLBatchedInvocationInput;
1111
import graphql.servlet.input.GraphQLInvocationInput;
1212
import graphql.servlet.input.GraphQLSingleInvocationInput;
13-
import java.util.Optional;
1413
import javax.servlet.http.HttpServletRequest;
1514
import javax.servlet.http.HttpServletResponse;
1615
import lombok.extern.slf4j.Slf4j;

0 commit comments

Comments
 (0)