4 Commits 3b09f31c8b ... 420bd21377

Author SHA1 Message Date
  herlanS_ 420bd21377 log content type 3 years ago
  herlanS_ cb3de34306 fix check multipart data 3 years ago
  herlanS_ 4129bd7330 fix check multipart data 3 years ago
  herlanS_ 71039b918d fix check multipart data 3 years ago

+ 2 - 3
src/main/kotlin/co/id/datacomsolusindo/ipphonebridge/BridgeFIlter.kt

@@ -6,7 +6,6 @@ import org.apache.logging.log4j.LogManager
 import org.springframework.core.Ordered
 import org.springframework.core.annotation.Order
 import org.springframework.core.io.ResourceLoader
-import org.springframework.http.HttpHeaders
 import org.springframework.http.HttpMethod
 import org.springframework.http.HttpStatus
 import org.springframework.messaging.simp.SimpMessagingTemplate
@@ -79,9 +78,9 @@ class BridgeFilter(private val template: SimpMessagingTemplate, val resourceLoad
                 try {
                     val headerMap = req.headerNames.toList().associateBy({ it }, { req.getHeader(it) })
                     val rb = RequestBuilder(reqId, toPath, HttpMethod.valueOf(req.method), headerMap.toMutableMap())
-
                     rb.queryString = req.queryString
-                    if (req.contentType != null && req.contentType.toLowerCase().indexOf("multipart/form-data") > -1) {
+                    AppLog.write(this.javaClass).info("content type = " + req.contentType)
+                    if (req.contentType?.toLowerCase()?.contains("multipart/form-data") == true) {
                         rb.parts =
                             req.parts.map {
                                 val subFilename = if (it.submittedFileName == null) {