Skip to content

Commit c1a2550

Browse files
committed
fix: encode spaces as %20 instead of + in license API URL path
1 parent 9c0702f commit c1a2550

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/java/io/github/guacsec/trustifyda/impl/ExhortApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ public CompletableFuture<ComponentAnalysisResult> componentAnalysisWithLicense(
602602
* @return a CompletableFuture with license details as a JsonNode, or null if not found
603603
*/
604604
public CompletableFuture<JsonNode> getLicenseDetails(String spdxId) {
605-
String encodedId = URLEncoder.encode(spdxId, StandardCharsets.UTF_8);
605+
String encodedId = URLEncoder.encode(spdxId, StandardCharsets.UTF_8).replace("+", "%20");
606606
URI uri = URI.create(String.format(S_API_V5_LICENSES, this.endpoint, encodedId));
607607
HttpRequest request = buildGetRequest(uri, "License Details");
608608

0 commit comments

Comments
 (0)