Skip to content
This repository was archived by the owner on Jun 30, 2023. It is now read-only.

Commit 02d139f

Browse files
committed
don't try to substitute proxy.html base path
This is essentially a no-op, since proxy.html no longer contains the /_ah/api string. All this does is save CPU cycles
1 parent 921f95a commit 02d139f

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

endpoints-framework/src/main/java/com/google/api/server/spi/handlers/ApiProxyHandler.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,12 @@
2525
* Serves the API proxy source with the correct API path.
2626
*/
2727
public class ApiProxyHandler implements DispatcherHandler<EndpointsContext> {
28-
public static final String DEFAULT_API_PATH = "/_ah/api";
29-
3028
private volatile String cachedProxyHtml;
3129

3230
@Override
3331
public void handle(EndpointsContext context) throws IOException {
3432
if (cachedProxyHtml == null) {
35-
String defaultProxyHtml = IoUtil.readResourceFile(ApiProxyHandler.class, "proxy.html");
36-
String apiPath = context.getRequest().getServletPath();
37-
cachedProxyHtml = DEFAULT_API_PATH.equals(apiPath) ? defaultProxyHtml
38-
: defaultProxyHtml.replace(DEFAULT_API_PATH, apiPath);
33+
cachedProxyHtml = IoUtil.readResourceFile(ApiProxyHandler.class, "proxy.html");
3934
}
4035
context.getResponse().setContentType("text/html");
4136
// This is a nonstandard value, but it seems sometimes X-Frame-Options can be injected by

0 commit comments

Comments
 (0)