Skip to content

Commit

Permalink
Redirect requests from cbioportal backend to matchminer API
Browse files Browse the repository at this point in the history
Redirect requests from cbioportal backend to matchminer API. Generate the matchminer URL path from cbioportal request URL path.
  • Loading branch information
jagnathan committed Sep 26, 2023
1 parent 1a83f1f commit fee9c97
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ public class MatchMinerController {
@RequestMapping(value = "/**", produces = "application/json")
public ResponseEntity<Object> 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");
Expand Down Expand Up @@ -64,4 +66,4 @@ public ResponseEntity<Object> proxy(@RequestBody(required = false) JSONObject bo
return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
}
}
}
}

0 comments on commit fee9c97

Please sign in to comment.