Request header field Dont-Chunk is not allowed by Access-Control-Allow-Headers in preflight response

AI 生成的摘要

brahn reported a CORS error after enabling Full site CDN acceleration for Discourse, where the Dont-Chunk header was blocked in preflight responses for requests containing the ?dip=t parameter. sam identified this as a bug in the Access Control process and provided a fix via a specific commit in post 3. brahn applied the patch manually within the Rails container by editing the file and restarting Unicorn for testing. The issue was confirmed resolved in post 5, with brahn thanking sam for the solution.

After setting up Full site CDN acceleration for Discourse I am seeing the following in chrome console:

XMLHttpRequest cannot load https://mydomain.com/message-bus/d487d3e56113405b95d297fbc468c99d/poll?dlp=t. Request header field Dont-Chunk is not allowed by Access-Control-Allow-Headers in preflight response.

Also, it doesn’t seem to always happen and it seems to be only those requests with the ?dip=t parameter:

The site is on stable, v1.6.1 and I am assuming that something in my config is not quite right but I am not sure where to start.

Any hints on where to look or how to approach diagnosing this?

Interesting, this is actually a but in our Access control process

Can you try:

https://github.com/discourse/discourse/commit/50379183e1deb6c3fae4b17ec46b96d1a18180c1

2 个赞

Thanks @sam
Can I push that into the rails app within the container somehow, just for testing, or is the only way to rebuild on the development branch?

Edit: I entered the app, edited this file and restart unicorn. That sound about right? Testing now…

This appears to be working for me now. Many thanks!

2 个赞