diff options
| author | soruly <[email protected]> | 2020-08-09 15:31:33 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-08-09 15:31:33 +0800 |
| commit | 472e9820d90fd486658c44cddb13b66c142da958 (patch) | |
| tree | e3173f13bc0498bf3ad42192e32851f66e5c20e7 | |
| parent | Add CORS headers (diff) | |
| download | trace.moe-image-proxy-472e9820d90fd486658c44cddb13b66c142da958.tar.xz trace.moe-image-proxy-472e9820d90fd486658c44cddb13b66c142da958.zip | |
Update image-proxy.ts
| -rw-r--r-- | api/image-proxy.ts | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/api/image-proxy.ts b/api/image-proxy.ts index 8628b5a..c53aec2 100644 --- a/api/image-proxy.ts +++ b/api/image-proxy.ts @@ -2,8 +2,7 @@ import { NowRequest, NowResponse } from "@now/node"; import fetch from "node-fetch"; export default async (request: NowRequest, response: NowResponse) => { - res.setHeader("Access-Control-Allow-Origin", "trace.moe"); - res.setHeader("Access-Control-Allow-Methods", "GET,OPTIONS"); + response.setHeader("Access-Control-Allow-Origin", "trace.moe"); const { url } = request.query; const imageURL = Array.isArray(url) ? url[0] : url; if (!imageURL) { |