mirror of
https://github.com/danbulant/Mangades
synced 2026-06-17 13:21:03 +00:00
add user agent header
This commit is contained in:
parent
d191ade47c
commit
790fc49fbc
2 changed files with 10 additions and 2 deletions
|
|
@ -2,7 +2,11 @@
|
|||
/** @type {import('./$types').RequestHandler} */
|
||||
export async function GET({ url }) {
|
||||
console.log("[CORS] " + url.searchParams.get('url'));
|
||||
const ret = await fetch(url.searchParams.get('url'));
|
||||
const ret = await fetch(url.searchParams.get('url'), {
|
||||
headers: {
|
||||
"User-agent": "manga.danbulant.eu (discord @techmandancz)"
|
||||
}
|
||||
});
|
||||
return new Response(await ret.arrayBuffer(), {
|
||||
headers: {
|
||||
...ret.headers,
|
||||
|
|
|
|||
|
|
@ -3,7 +3,11 @@ import { json } from '@sveltejs/kit';
|
|||
/** @type {import('./$types').RequestHandler} */
|
||||
export async function GET({ url }) {
|
||||
console.log("[CORS-DBG] " + url.searchParams.get('url'));
|
||||
const ret = await fetch(url.searchParams.get('url'));
|
||||
const ret = await fetch(url.searchParams.get('url'), {
|
||||
headers: {
|
||||
"User-agent": "manga.danbulant.eu (discord @techmandancz)"
|
||||
}
|
||||
});
|
||||
let text = await ret.text();
|
||||
let data = text;
|
||||
try {
|
||||
|
|
|
|||
Loading…
Reference in a new issue