Skip to content

Commit

Permalink
Fix handling of special characters in download location data
Browse files Browse the repository at this point in the history
  • Loading branch information
FOSSLight-dev committed Aug 21, 2023
1 parent bc43202 commit 9712889
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

package oss.fosslight.service.impl;

import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
Expand Down Expand Up @@ -161,6 +162,7 @@ public Map<String, Object> checkOssLicense(List<ProjectIdentification> ossList){
}

if (!downloadLocation.isEmpty()) {
oss.setDownloadLocation(URLDecoder.decode(oss.getDownloadLocation()));
if (oss.getDownloadLocation().contains(";")) {
oss.setDownloadLocation(oss.getDownloadLocation().split(";")[0]);
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/oss/fosslight/service/impl/OssServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import java.lang.reflect.Type;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLDecoder;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Arrays;
Expand Down Expand Up @@ -2200,6 +2201,7 @@ public List<ProjectIdentification> checkOssName(List<ProjectIdentification> list
String semicolonStr = "";
String downloadLocation = bean.getDownloadLocation();

bean.setDownloadLocation(URLDecoder.decode(bean.getDownloadLocation()));
if (bean.getDownloadLocation().contains(";")) {
semicolonFlag = true;
int idx = 0;
Expand Down

0 comments on commit 9712889

Please sign in to comment.