Skip to content

Commit

Permalink
Merge pull request #6 from ponxu/patch-1
Browse files Browse the repository at this point in the history
Update cloudflare-worker.js
  • Loading branch information
barretlee authored Apr 6, 2023
2 parents 44c732b + 4f87241 commit 1e7c2f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cloudflare-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ async function handleRequest(request) {
const url = new URL(request.url);
const fetchAPI = request.url.replace(url.host, 'api.openai.com');

// 部分代理工具,请求又浏览器发起,跨域请求时会先发送一个 preflight 进行检查,也就是 OPTIONS 请求
// 部分代理工具,请求由浏览器发起,跨域请求时会先发送一个 preflight 进行检查,也就是 OPTIONS 请求
// 需要响应该请求,否则后续的 POST 会失败
const corsHeaders = {
'Access-Control-Allow-Origin': '*',
Expand Down

0 comments on commit 1e7c2f6

Please sign in to comment.