github-advanced-security[bot] commented on code in PR #2685:
URL:
https://github.com/apache/incubator-hugegraph/pull/2685#discussion_r1804738979
##########
hugegraph-pd/hg-pd-service/src/main/java/org/apache/hugegraph/pd/rest/PartitionAPI.java:
##########
@@ -269,6 +284,61 @@
}
}
+ @GetMapping(value = "/partitionsAndGraphId", produces =
MediaType.APPLICATION_JSON_VALUE)
+ public Map<Long, Long> getPartitionsAndGraphId(@RequestParam String
graphName) {
+ log.info("getPartGraphId: " + graphName);
+ if (isLeader()) {
+ return getPartGraphId(graphName);
+ } else {
+ String leaderAddress =
RaftEngine.getInstance().getLeader().getIp();
+ String url = "http://" + leaderAddress+":8620" +
"/v1/partitionsAndGraphId" ;
+ String urlWithParams =
UriComponentsBuilder.fromHttpUrl(url).queryParam("graphName",
graphName).toUriString();
+ ResponseEntity<HashMap<Long, Long>> responseEntity =
restTemplate.exchange(
+ urlWithParams,
Review Comment:
## Server-side request forgery
Potential server-side request forgery due to a [user-provided value](1).
[Show more
details](https://github.com/apache/incubator-hugegraph/security/code-scanning/81)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]