|
@@ -76,18 +76,11 @@ class BridgeFilter(private val template: SimpMessagingTemplate, val resourceLoad
|
|
val client = splitPath[1]
|
|
val client = splitPath[1]
|
|
val toPath = "/" + splitPath.takeLast(splitPath.size - 1).joinToString("/")
|
|
val toPath = "/" + splitPath.takeLast(splitPath.size - 1).joinToString("/")
|
|
val clientNumber = client.toIntOrNull()
|
|
val clientNumber = client.toIntOrNull()
|
|
- if (clientNumber != null && clientNumber > 0 && clientNumber <= 999) {
|
|
|
|
|
|
+ if (clientNumber != null && clientNumber > 0 && clientNumber <= 999 && ClientHolder.get().containsKey(clientNumber.toString())) {
|
|
val search = isResourceAvailable(toPath)
|
|
val search = isResourceAvailable(toPath)
|
|
if (search != null && !search.endsWith("assets/bootstrap.js")) {
|
|
if (search != null && !search.endsWith("assets/bootstrap.js")) {
|
|
res.sendRedirect("/resources/$search")
|
|
res.sendRedirect("/resources/$search")
|
|
} else {
|
|
} else {
|
|
- if(!ClientHolder.get().containsKey(clientNumber.toString())){
|
|
|
|
- res.status = HttpStatus.NOT_FOUND.value()
|
|
|
|
- res.writer.write("{\"message\":\"resource not found\"}")
|
|
|
|
- res.flushBuffer()
|
|
|
|
- return
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
LogManager.getLogger("client-$client")
|
|
LogManager.getLogger("client-$client")
|
|
.info("Request Start, UA: " + req.getHeader("User-Agent") + " From: " + InetAddress.getLocalHost().hostAddress + " To: " + req.requestURL.toString() + "?" + req.queryString)
|
|
.info("Request Start, UA: " + req.getHeader("User-Agent") + " From: " + InetAddress.getLocalHost().hostAddress + " To: " + req.requestURL.toString() + "?" + req.queryString)
|
|
|
|
|