aboutsummaryrefslogtreecommitdiff
path: root/src/routes/api/proxy/+server.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/api/proxy/+server.ts')
-rw-r--r--src/routes/api/proxy/+server.ts18
1 files changed, 0 insertions, 18 deletions
diff --git a/src/routes/api/proxy/+server.ts b/src/routes/api/proxy/+server.ts
deleted file mode 100644
index c4bf74a6..00000000
--- a/src/routes/api/proxy/+server.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-export const GET = async ({ url }) => {
- const response = await fetch(url.searchParams.get('url') as string);
- const contentType = response.headers.get('content-type') as string;
-
- if (contentType.includes('application/json')) {
- return Response.json(await response.json(), {
- headers: { 'Content-Type': 'application/json' }
- });
- } else if (contentType.includes('text/html') || contentType.includes('text/plain')) {
- return new Response(await response.text(), {
- headers: { 'Content-Type': contentType }
- });
- } else {
- return new Response(await response.blob(), {
- headers: { 'Content-Type': contentType }
- });
- }
-};