Skip to content

claude似乎存在跨域问题 #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Evanora-y opened this issue Nov 15, 2024 · 2 comments
Open

claude似乎存在跨域问题 #1

Evanora-y opened this issue Nov 15, 2024 · 2 comments

Comments

@Evanora-y
Copy link

claude似乎存在跨域问题,大陆可以解决一下吗

@lopinv
Copy link

lopinv commented Dec 13, 2024

claude似乎存在跨域问题,大陆可以解决一下吗

  // 部分代理工具,请求由浏览器发起,跨域请求时会先发送一个 preflight 进行检查,也就是 OPTIONS 请求
  // 需要响应该请求,否则后续的 POST 会失败
  const corsHeaders = {
    'Access-Control-Allow-Origin': '*',
    'Access-Control-Allow-Methods': 'OPTIONS',
    'Access-Control-Allow-Headers': '*',
  };
  if (request.method === 'OPTIONS') return new Response(null, { headers: corsHeaders });

由于帐号已被限制暂停,无法登陆和推送更新,你需要自己添加

@lopinx
Copy link

lopinx commented Dec 29, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants