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

[BUG?] FusionExceptionView drops all header information from rendered output #4964

Open
Sebobo opened this issue Mar 27, 2024 · 1 comment
Open

Comments

@Sebobo
Copy link
Member

Sebobo commented Mar 27, 2024

In

protected function extractBodyFromOutput(string $output): string
all rendered header data from the rendered Fusion output is dropped. Therefore custom headers like Content-Type or others don't have any effect.

In my case I wanted to respond with JSON responses für 404 requests in a Fusion based API.
But the Content-Type was text/html instead of my configured application/json type.

My workaround was now to check the output for json content in the custom ExceptionHandler we use in the affected project and adjust the header manually.

Neos: 8.3
Flow: 8.3

@mhsdesign
Copy link
Member

As im currently on this topic for Neos 9 we can fix it see also

neos/flow-development-collection#3286 (comment)

The question would be

Yeah we can add the headers but which status code should we use? The one inferred from the FlowException / 500 or the one from the view?

Maybe: use from the view if it’s NOT 200 and else fallback to the current logic?

wdyt?

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

No branches or pull requests

2 participants