mirror of
https://github.com/misskey-dev/summerflare.git
synced 2025-04-29 02:37:17 +09:00
refactor: tweak
This commit is contained in:
parent
475ba6baba
commit
c521b2482a
@ -1,7 +1,7 @@
|
|||||||
function parseRFC9110ListsLax(value: string | null): string[] {
|
function parseRFC9110ListsLax(value: string | null): string[] {
|
||||||
return (
|
return (
|
||||||
value
|
value
|
||||||
?.split(/(?<=^[^"]*|^(?:[^"]*"[^"]*"[^"]*)*),/)
|
?.split(/(?<=^[^"]*(?:(?:"[^"]*){2})*),/)
|
||||||
.map((value) => value.trim())
|
.map((value) => value.trim())
|
||||||
.filter((value) => value) ?? []
|
.filter((value) => value) ?? []
|
||||||
)
|
)
|
||||||
@ -20,13 +20,13 @@ export function requestInit(request: Request) {
|
|||||||
"200-299": 86400,
|
"200-299": 86400,
|
||||||
"400-599": 60,
|
"400-599": 60,
|
||||||
},
|
},
|
||||||
} satisfies RequestInitCfProperties,
|
},
|
||||||
headers: {
|
headers: {
|
||||||
Accept: "text/html, application/xhtml+xml, application/xml;q=0.9, */*;q=0.8",
|
Accept: "text/html, application/xhtml+xml, application/xml;q=0.9, */*;q=0.8",
|
||||||
"CDN-Loop": cdnLoop.concat(url.hostname).join(", "),
|
"CDN-Loop": cdnLoop.concat(url.hostname).join(", "),
|
||||||
"User-Agent": "Mozilla/5.0 (compatible; Summerflare; +https://github.com/misskey-dev/summerflare)",
|
"User-Agent": "Mozilla/5.0 (compatible; Summerflare; +https://github.com/misskey-dev/summerflare)",
|
||||||
},
|
},
|
||||||
}
|
} satisfies RequestInit
|
||||||
}
|
}
|
||||||
|
|
||||||
if (import.meta.vitest) {
|
if (import.meta.vitest) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user