fix: image proxy

This commit is contained in:
Ou 2024-11-01 20:27:09 +08:00
parent ed0277274f
commit c5feeff89a

View File

@ -1,7 +1,7 @@
export default defineEventHandler(async (event) => {
const { url: img, type = "encodeURIComponent" } = getQuery(event)
if (img) {
const url = type === "encodeURIComponent" ? encodeURIComponent(img as string) : decodeBase64URL(img as string)
const url = type === "encodeURIComponent" ? decodeURIComponent(img as string) : decodeBase64URL(img as string)
return sendProxy(event, url, {
headers: {
"Access-Control-Allow-Origin": "*",