LoggingInterceptor
LoggingInterceptor copied to clipboard
Please remove the escape character in the json url
Please remove the escape character in the json url, it will affect the http url preview, it is caused by jsonObject or JsonArray, for example: http:\/\/xx.xxx.xxx\/image\/20210114\/5beaba40044e421f8dbad2b0e5726d42.jpg, \/Replace with/
Printer.class
private fun getJsonString(msg: String): String {
var message: String
message = try {
when {
msg.startsWith("{") -> {
val jsonObject = JSONObject(msg)
jsonObject.toString(JSON_INDENT)
}
msg.startsWith("[") -> {
val jsonArray = JSONArray(msg)
jsonArray.toString(JSON_INDENT)
}
else -> {
msg
}
}
} catch (e: JSONException) {
msg
} catch (e1: OutOfMemoryError) {
OOM_OMITTED
}
// TODO: 2021/1/18 Add code here
if (message.indexOf("\\/") != -1) {
message = message.replace("\\/", "/")
}
return message
}