Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Json ouput response encoding #946

Open
P-VINODKRISHNA opened this issue Dec 5, 2024 · 1 comment
Open

Json ouput response encoding #946

P-VINODKRISHNA opened this issue Dec 5, 2024 · 1 comment

Comments

@P-VINODKRISHNA
Copy link

In my krakend json when I make assign output encoding as json only successfull requests response is getting shown to frontend but failed ones coming invalid status code in krakend logs can anybody give me clarity on this if I choose no-op I am facing cors issue in frontend

@thedae
Copy link
Member

thedae commented Dec 9, 2024

When you configure an endpoint with multiple backends, KrakenD is designed to discard failed requests if at least one of them responded correctly. In this scenario, the X-Krakend-Completed header flag will be set to false to let the client know there's something wrong. More info about the merge aggregation strategy here: https://www.krakend.io/docs/endpoints/response-manipulation/#aggregation-and-merging

You can ignore this strategy and go for a no-op configuration as you mentioned. If you are facing CORS issues is most likely because the input_headers config parameter is set to wildcard *, thus all the headers from the frontend request, including the CORS ones, are proxied to the backends. To workaround this, you can either:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants