|
|
|
@ -15,7 +15,7 @@ import org.springframework.http.ResponseEntity; |
|
|
|
import org.springframework.jdbc.core.JdbcTemplate; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.web.client.RestTemplate; |
|
|
|
import org.springframework.web.client.RestTemplate; |
|
|
|
|
|
|
|
import com.fasterxml.jackson.core.type.TypeReference; |
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper; |
|
|
|
@ -120,6 +120,7 @@ public class BirthAndDeathDetailsService { |
|
|
|
|
|
|
|
// Remove illegal control characters (but keep line breaks if needed) |
|
|
|
return rawJson |
|
|
|
.replace("\\", "\\\\") // Escape backslashes |
|
|
|
.replaceAll("[\\p{Cntrl}&&[^\r\n\t]]", "") // Remove non-printable control characters (except tabs/newlines) |
|
|
|
.replaceAll("\t", "") // Remove tab characters explicitly (common cause of error) |
|
|
|
.replaceAll("\\s*:\\s*\n\\s*\"", ":\"") // Fix broken key-value splits |
|
|
|
|