Open a21211 opened 3 weeks ago
just use CORSMiddleware
app.add_middleware(
CORSMiddleware,
allow_origins=origins, #设置允许的origins来源
allow_credentials=True,
allow_methods=["*"], # 设置允许跨域的http方法,比如 get、post、put等。
allow_headers=["*"]) #允许跨域的headers,可以用来鉴别来源等作用。
Access to fetch at 'http://ip1:11434/api/chat' from origin 'http://ip2:3000' has been blocked by CORS policy: The request client is not a secure context and the resource is in more-private address space
private
. llm:466how to deal with Cors ?