Skip to content

Commit 9ffaeb7

Browse files
authored
fix: code style
1 parent 33ed4c6 commit 9ffaeb7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

servlet/src/main/java/io/grpc/servlet/GrpcServlet.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ private String getMethod(HttpServletRequest req) {
6363
Boolean removeContextPath = Boolean.parseBoolean(getInitParameter(REMOVE_CONTEXT_PATH));
6464
String method = req.getRequestURI();
6565
if (removeContextPath) {
66-
method = method.substring(req.getContextPath().length()); // remove Context Path from application server
66+
// remove context path used in application server
67+
method = method.substring(req.getContextPath().length());
6768
}
6869
return method.substring(1); // remove the leading "/"
6970
}

servlet/src/main/java/io/grpc/servlet/ServletAdapter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOExc
111111
* <p>Do not modify {@code req} and {@code resp} before or after calling this method. However,
112112
* calling {@code resp.setBufferSize()} before invocation is allowed.
113113
*/
114-
public void doPost(String method, HttpServletRequest req, HttpServletResponse resp) throws IOException {
114+
public void doPost(String method, HttpServletRequest req, HttpServletResponse resp)
115+
throws IOException {
115116
checkArgument(req.isAsyncSupported(), "servlet does not support asynchronous operation");
116117
checkArgument(ServletAdapter.isGrpc(req), "the request is not a gRPC request");
117118

0 commit comments

Comments
 (0)