Skip to content

Commit 188fcb2

Browse files
xingzhang-suselsongsuse
authored andcommitted
NVSHAS-10200: Vulnerabilities filter: Internal Server Error occurs when unmatched strings is filtered
1 parent f42972d commit 188fcb2

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

admin/src/main/scala/com/neu/service/risk/RiskService.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import org.apache.pekko.http.scaladsl.server.Route
1818

1919
import scala.concurrent.TimeoutException
2020
import scala.util.control.NonFatal
21+
import java.net.URLEncoder
22+
import java.nio.charset.StandardCharsets
2123

2224
class RiskService extends BaseService with DefaultJsonFormats with LazyLogging {
2325

@@ -62,7 +64,7 @@ class RiskService extends BaseService with DefaultJsonFormats with LazyLogging {
6264
else ""
6365
}${
6466
if (qf.isDefined)
65-
s"&qf=${qf.get}"
67+
s"&qf=${URLEncoder.encode(qf.get, StandardCharsets.UTF_8.toString)}"
6668
else ""
6769
}"
6870
RestClient.httpRequestWithHeader(url, GET, "", tokenId)
@@ -107,7 +109,7 @@ class RiskService extends BaseService with DefaultJsonFormats with LazyLogging {
107109
else ""
108110
}${
109111
if (qf.isDefined)
110-
s"&qf=${qf.get}"
112+
s"&qf=${URLEncoder.encode(qf.get, StandardCharsets.UTF_8.toString)}"
111113
else ""
112114
}${
113115
if (scoretype.isDefined)

0 commit comments

Comments
 (0)