cruise-control-ui icon indicating copy to clipboard operation
cruise-control-ui copied to clipboard

CORS issue on Executor State page if cache headers are included

Open desobolevsky opened this issue 2 years ago • 5 comments

I'm experiencing this issue on Executor State tab, though every other tab and everything in general works perfectly fine. image Looks like I get the error on CORS preflight request. image Tried to fix this issue myself, removing cache headers from Executor component resolves it, Executor tab works good with the request like that:

vm.$http.get(vm.url, {withCredentials: true}).then((r) => {

Any thoughts on the appearing issue?

CC-UI is on master branch CC is on migrate_to_kafka_2_5 branch Kafka: 3.1.1 (Commit:5cf0285dc9728b0b)

desobolevsky avatar Aug 10 '22 08:08 desobolevsky

getting the same error

Access to XMLHttpRequest at 'https://xxx.com/kafkacruisecontrol/state?substates=EXECUTOR&verbose=true&json=true' from origin 'https://xxxx.com' has been blocked by CORS policy: Request header field cache-buster is not allowed by Access-Control-Allow-Headers in preflight response.

IronforgeV avatar Aug 21 '22 01:08 IronforgeV

getting the same error

Access to XMLHttpRequest at 'https://xxx.com/kafkacruisecontrol/state?substates=EXECUTOR&verbose=true&json=true' from origin 'https://xxxx.com' has been blocked by CORS policy: Request header field cache-buster is not allowed by Access-Control-Allow-Headers in preflight response.

fixed by adding Cache-buster to the webserver.http.cors.exposeheaders in cruisecontrol.properties file

webserver.http.cors.exposeheaders=User-Task-ID,Content-Type,Cache-buster

IronforgeV avatar Aug 21 '22 01:08 IronforgeV

@desobolevsky can you raise a PR for this ?

nareshv avatar Sep 05 '22 09:09 nareshv

@nareshv seems like everything works if Cache-Buster header is specified in cruisecontrol.properties, so I don't think this code needs a correction. IMO it makes sense to add this header to default cruisecontrol.properties file in cruise-control repository. Any thoughts of that? If it's ok I'll raise the issue and close this one

desobolevsky avatar Sep 23 '22 15:09 desobolevsky

yep, lets add this config change to actual CC itself as a PR

nareshv avatar Sep 30 '22 09:09 nareshv

created https://github.com/linkedin/cruise-control/issues/1950 and will follow there

nareshv avatar Dec 07 '22 03:12 nareshv