mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2026-02-11 12:10:28 +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
|
// attachment;filename=xxx.yaml; filename*=UTF-8''%xx%xx%xx
|
||||||
function parseFilename(str: string): string {
|
function parseFilename(str: string): string {
|
||||||
if (str.includes("filename*=UTF-8''")) {
|
if (str.match(/filename\*=.*''/)) {
|
||||||
const filename = decodeURIComponent(str.split("filename*=UTF-8''")[1])
|
const filename = decodeURIComponent(str.split(/filename\*=.*''/)[1])
|
||||||
return filename
|
return filename
|
||||||
} else {
|
} else {
|
||||||
const filename = str.split('filename=')[1]
|
const filename = str.split('filename=')[1]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user