Skip to content

Commit 68dddf0

Browse files
committed
Remove useless URL-rewriting logic from the Java FF. The code seems to be based on the idea that the function servlet is registered with a servlet path that is the name of the function (/myfunction) but actually the servlet path is always empty. So the existing logic has no effect.
PiperOrigin-RevId: 296277143
1 parent 5bde734 commit 68dddf0

File tree

3 files changed

+2
-44
lines changed

3 files changed

+2
-44
lines changed

invoker/core/src/main/java/com/google/cloud/functions/invoker/HttpFunctionExecutor.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ public HttpFunctionExecutor(HttpCloudFunction function) {
3030
/** Executes the user's method, can handle all HTTP type methods. */
3131
@Override
3232
public void service(HttpServletRequest req, HttpServletResponse res) {
33-
URLRequestWrapper wrapper = new URLRequestWrapper(req);
3433
try {
35-
function.execute(wrapper, res);
34+
function.execute(req, res);
3635
} catch (InvocationTargetException e) {
3736
res.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
3837
e.getCause().printStackTrace();

invoker/core/src/main/java/com/google/cloud/functions/invoker/NewHttpFunctionExecutor.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ public static NewHttpFunctionExecutor forClass(Class<?> functionClass) {
5959
/** Executes the user's method, can handle all HTTP type methods. */
6060
@Override
6161
public void service(HttpServletRequest req, HttpServletResponse res) {
62-
URLRequestWrapper wrapper = new URLRequestWrapper(req);
63-
HttpRequestImpl reqImpl = new HttpRequestImpl(wrapper);
62+
HttpRequestImpl reqImpl = new HttpRequestImpl(req);
6463
HttpResponseImpl respImpl = new HttpResponseImpl(res);
6564
try {
6665
function.service(reqImpl, respImpl);

invoker/core/src/main/java/com/google/cloud/functions/invoker/URLRequestWrapper.java

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)