Skip to content

Commit 0212a9a

Browse files
committed
fix: prevent cookie transfer during xml fetches
1 parent ddedb41 commit 0212a9a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lib/api/fetchRSS.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,10 @@ export const fetchRSS = async (xmlUrl: string | string[]) => {
130130
*/
131131
export const fetchXml = async (url: string) => {
132132
try {
133-
const response = await fetch(url)
133+
const response = await fetch(url, {
134+
headers: { Cookie: "", DNT: "1" }, // Empty cookie header and do-not-track
135+
credentials: "omit", // Don't send or receive cookies
136+
})
134137
const xml = await response.text()
135138
let returnObject: Record<string, unknown> = {}
136139
parseString(xml, (err, result) => {

0 commit comments

Comments
 (0)