From 6dbbb1183d032dbc9ca1db9142166c42f5e88554 Mon Sep 17 00:00:00 2001 From: IgorRodchenkov Date: Sun, 26 May 2024 19:52:44 -0400 Subject: [PATCH] Added '/v2' to the disallowed paths list that '/robots.txt' returns; removed some comments. --- src/main/java/cpath/web/BasicController.java | 1 - src/main/java/cpath/web/GlobalControllerAdvice.java | 3 --- src/main/java/cpath/web/PagesController.java | 1 + 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/java/cpath/web/BasicController.java b/src/main/java/cpath/web/BasicController.java index 7d4adcf5..9cd36908 100644 --- a/src/main/java/cpath/web/BasicController.java +++ b/src/main/java/cpath/web/BasicController.java @@ -61,7 +61,6 @@ final void errorResponse(ServiceQuery args, HttpServletRequest request, HttpServletResponse response) { - // TODO: switch to using @RestControllerAdvice and @ExceptionHandler try { //log/track using a shorter message audit(request, args, null, error); diff --git a/src/main/java/cpath/web/GlobalControllerAdvice.java b/src/main/java/cpath/web/GlobalControllerAdvice.java index 75b1d74b..f405d493 100644 --- a/src/main/java/cpath/web/GlobalControllerAdvice.java +++ b/src/main/java/cpath/web/GlobalControllerAdvice.java @@ -5,8 +5,6 @@ import cpath.service.api.OutputFormat; import cpath.service.metadata.Datasource; import cpath.web.args.binding.*; -import org.biopax.paxtools.model.BioPAXElement; -import org.biopax.paxtools.pattern.miner.SIFEnum; import org.biopax.paxtools.pattern.miner.SIFType; import org.biopax.paxtools.query.algorithm.Direction; import org.biopax.paxtools.query.algorithm.LimitType; @@ -43,6 +41,5 @@ public void registerCustomEditors(WebDataBinder binder, WebRequest request) { binder.registerCustomEditor(GraphType.class, new GraphTypeEditor()); binder.registerCustomEditor(LimitType.class, new GraphQueryLimitEditor()); binder.registerCustomEditor(SIFType.class, new SIFTypeEditor()); //also works for the SIFEnum subclass -// binder.registerCustomEditor(SIFEnum.class, new SIFTypeEditor()); } } diff --git a/src/main/java/cpath/web/PagesController.java b/src/main/java/cpath/web/PagesController.java index 92adfc43..a1259b87 100644 --- a/src/main/java/cpath/web/PagesController.java +++ b/src/main/java/cpath/web/PagesController.java @@ -69,6 +69,7 @@ String robots() { // deny robots access to logs, web services and data files, // but allow - to web page resources (css, js, images) return "User-agent: *\n" + + "Disallow: /v2\n" + "Disallow: /fetch\n" + "Disallow: /search\n" + "Disallow: /graph\n" +