From 4129e89bf29f17098d763e8fc64a9cc28e40da0f Mon Sep 17 00:00:00 2001 From: Prasanna Kumar Jagannathan <37613906+jagnathan@users.noreply.github.com> Date: Thu, 3 Aug 2023 11:55:43 -0400 Subject: [PATCH] Redirect requests from cbioportal backend to matchminer API Redirect requests from cbioportal backend to matchminer API. Generate the matchminer URL path from cbioportal request URL path. --- .../java/org/cbioportal/web/MatchMinerController.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/web/src/main/java/org/cbioportal/web/MatchMinerController.java b/web/src/main/java/org/cbioportal/web/MatchMinerController.java index 874dfa4f6dd..0217b565e75 100644 --- a/web/src/main/java/org/cbioportal/web/MatchMinerController.java +++ b/web/src/main/java/org/cbioportal/web/MatchMinerController.java @@ -35,8 +35,10 @@ public class MatchMinerController { @RequestMapping(value = "/**", produces = "application/json") public ResponseEntity proxy(@RequestBody(required = false) JSONObject body, HttpMethod method, HttpServletRequest request) { try { - String path = request.getPathInfo().replace("/matchminer", ""); - URI uri = new URI(this.url + path); + String path = request.getRequestURI(); + int mmindex = path.indexOf("/matchminer"); + String requestpath = path.substring(mmindex+11); + URI uri = new URI(this.url + requestpath); HttpHeaders httpHeaders = new HttpHeaders(); String contentType = request.getHeader("Content-Type"); @@ -64,4 +66,4 @@ public ResponseEntity proxy(@RequestBody(required = false) JSONObject bo return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR); } } -} \ No newline at end of file +}