[refactor] proxy url by header

This commit is contained in:
kwaroran
2023-07-07 06:30:04 +09:00
parent ead670516d
commit e338940708
3 changed files with 9 additions and 4 deletions

View File

@@ -12,7 +12,9 @@ async function fetchProxy(request) {
let response = null;
let rurl = new URL(request.url);
const urlParam = rurl.searchParams.get('url')
const nheader = request.headers.get('risu-url') ? decodeURIComponent(request.headers.get('risu-url')) : null
const urlParam = nheader ?? rurl.searchParams.get('url')
if(!urlParam){
return new Response('Access denied', {