CloudFlow icon indicating copy to clipboard operation
CloudFlow copied to clipboard

Incorrect Accept HTTP header

Open Berbe opened this issue 3 years ago • 1 comments

The current Accept HTTP header used by Cloudflow is incorrect:

Accept: application/json, text/plain, */*

While RedHat/OpenStack do not seem to have advertised the change (from what I found/read), the default Content-Type for the /v2/executions Mistral REST API has switched from application/json to application/xml between v7 (Rocky) & v15 (Zed); no idea on exactly when.

While the seemingly undocumented change from Mistral would be problematic, the Accept header from Cloudflow remains the main struggle here, as Cloudflow does not actually support anything other than application/json.

The required fox would be to switch to:

Accept: application/json

Currently, I see 2 ways to solve the problem:

  • angular/common fixing the way it handles Accept depending on the expected output format; cf. https://github.com/angular/angular/issues/48505
  • Setting the Accept HTTP header in the headers parameter of the HttpClient call; cf current master code section.

Berbe avatar Dec 15 '22 10:12 Berbe

Just FYI for anyone running into this issue and does not want to bother compiling a new version for the fix, you can just add proxy_set_header Accept "application/json; charset=UTF-8"; into you cloudflow.nginx.config under location ~* ^/api { line.

This is for nginx specifically but apache should be pretty similar.

gimbald avatar May 28 '25 08:05 gimbald