mirror of
https://github.com/amir1376/ab-download-manager.git
synced 2025-02-20 11:43:24 +08:00
fix some URLEncoded filenames are not decoded properly
This commit is contained in:
parent
caa5538a9d
commit
eff6928930
@ -12,6 +12,8 @@
|
||||
|
||||
### Fixed
|
||||
|
||||
- some URLEncoded filenames are not decoded properly
|
||||
|
||||
### Security
|
||||
|
||||
## 1.0.7
|
||||
|
@ -1,4 +1,5 @@
|
||||
package ir.amirab.downloader.connection.response.headers
|
||||
|
||||
import java.net.URLDecoder
|
||||
|
||||
fun extractFileNameFromContentDisposition(contentDispositionValue: String): String? {
|
||||
@ -16,6 +17,9 @@ fun extractFileNameFromContentDisposition(contentDispositionValue: String): Stri
|
||||
?.groups
|
||||
?.get("fileName")
|
||||
?.value?.let {
|
||||
runCatching { URLDecoder.decode(it, Charsets.UTF_8) }
|
||||
.getOrNull()
|
||||
}?.let {
|
||||
return it
|
||||
}
|
||||
return null
|
||||
|
Loading…
x
Reference in New Issue
Block a user