mirror of
https://github.com/hiddify/hiddify-next.git
synced 2026-07-13 21:19:28 +08:00
add content-disposition for profile title
This commit is contained in:
parent
40901dce96
commit
6fc52bcee1
@ -42,6 +42,18 @@ class Profile with _$Profile {
|
||||
title = titleHeader;
|
||||
}
|
||||
}
|
||||
|
||||
if (title.isEmpty) {
|
||||
final contentDisposition = headers['content-disposition']?.single;
|
||||
if (contentDisposition != null) {
|
||||
final RegExp regExp = RegExp(r'filename="([^"]*)"');
|
||||
final match = regExp.firstMatch(contentDisposition);
|
||||
if (match != null && match.groupCount >= 1) {
|
||||
title = match.group(1) ?? '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (title.isEmpty) {
|
||||
final part = url.split("/").lastOrNull;
|
||||
if (part != null) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user