mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
fix: forward headers during requests where needed
this is mainly just so any ip headers like cf-connecting-ip are forwarded for rate limiting
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
import type { RequestHandler } from '@sveltejs/kit';
|
||||
import { apiUrl } from '$lib/server/api';
|
||||
|
||||
export const GET: RequestHandler = async ({ params }) => {
|
||||
export const GET: RequestHandler = async ({ params, request }) => {
|
||||
const { id } = params;
|
||||
const headers = new Headers(request.headers);
|
||||
|
||||
const res = await fetch(`${apiUrl}/api/paste/${id}/raw`);
|
||||
const res = await fetch(`${apiUrl}/api/paste/${id}/raw`, {
|
||||
headers: headers
|
||||
});
|
||||
|
||||
if (res.status === 404) {
|
||||
return new Response(null, {
|
||||
|
||||
Reference in New Issue
Block a user