mirror of
https://github.com/ourongxing/newsnow.git
synced 2025-01-19 03:09:14 +08:00
fix: image proxy
This commit is contained in:
parent
ed0277274f
commit
c5feeff89a
@ -1,7 +1,7 @@
|
|||||||
export default defineEventHandler(async (event) => {
|
export default defineEventHandler(async (event) => {
|
||||||
const { url: img, type = "encodeURIComponent" } = getQuery(event)
|
const { url: img, type = "encodeURIComponent" } = getQuery(event)
|
||||||
if (img) {
|
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, {
|
return sendProxy(event, url, {
|
||||||
headers: {
|
headers: {
|
||||||
"Access-Control-Allow-Origin": "*",
|
"Access-Control-Allow-Origin": "*",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user