mirror of
https://github.com/Corewala/Buran
synced 2025-01-02 21:24:19 +00:00
Fixed inline images with query strings
This commit is contained in:
parent
913bf12686
commit
494997c0ea
1 changed files with 4 additions and 6 deletions
|
@ -184,12 +184,10 @@ class GeminiDatasource(private val context: Context, val history: BuranHistory):
|
||||||
|
|
||||||
private fun getBinary(socket: SSLSocket?, uri: URI, header: GeminiResponse.Header, onUpdate: (state: GemState) -> Unit){
|
private fun getBinary(socket: SSLSocket?, uri: URI, header: GeminiResponse.Header, onUpdate: (state: GemState) -> Unit){
|
||||||
|
|
||||||
var filename: String? = null
|
val charset = "ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz0123456789"
|
||||||
val fileSegmentIndex: Int = uri.path.lastIndexOf('/')
|
val filename = (1..12)
|
||||||
|
.map{charset.random()}
|
||||||
when {
|
.joinToString("")
|
||||||
fileSegmentIndex != -1 -> filename = uri.path.substring(fileSegmentIndex + 1)
|
|
||||||
}
|
|
||||||
|
|
||||||
val host = uri.host.replace(".", "_")
|
val host = uri.host.replace(".", "_")
|
||||||
val cacheName = "${host}_$filename"
|
val cacheName = "${host}_$filename"
|
||||||
|
|
Loading…
Reference in a new issue