API 在 OPTIONS CORS 预检时返回 404

尝试发起跨域请求时(在我的案例中,是通过 /posts.json 创建新帖子),API 莫名其妙地返回“404 Not Found”,导致 OPTIONS 预检请求失败。

响应头如下:

HTTP/2 404 Not Found
date: Fri, 09 Apr 2021 17:59:03 GMT
content-encoding: gzip
content-type: text/html; charset=utf-8
status: 404 Not Found
x-request-id: f8378b677d9c0a44993289c4c06bcfa3
x-runtime: 0.054407

我还在 Discourse 的 GitHub 仓库中看到了这个提交,它本应修复此问题,但我仍然不清楚为什么会发生这种情况。

感谢您的帮助。