mirror of
https://github.com/pompurin404/mihomo-party.git
synced 2024-11-16 11:42:19 +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…
Reference in New Issue
Block a user