mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2026-02-11 04:00:32 +08:00
fix filename parser
This commit is contained in:
parent
0c566bdeb5
commit
d2e0db40b3
@ -173,8 +173,8 @@ export async function getProfile(id: string | undefined): Promise<IMihomoConfig>
|
||||
|
||||
// attachment;filename=xxx.yaml; filename*=UTF-8''%xx%xx%xx
|
||||
function parseFilename(str: string): string {
|
||||
if (str.includes("filename*=UTF-8''")) {
|
||||
const filename = decodeURIComponent(str.split("filename*=UTF-8''")[1])
|
||||
if (str.match(/filename\*=.*''/)) {
|
||||
const filename = decodeURIComponent(str.split(/filename\*=.*''/)[1])
|
||||
return filename
|
||||
} else {
|
||||
const filename = str.split('filename=')[1]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user