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

Implement PSR-7 for Neos 5.0 compatibility #19

Closed
wants to merge 3 commits into from

Conversation

ComiR
Copy link
Contributor

@ComiR ComiR commented Oct 31, 2019

To be compatible with Neos 5.0 PSR-7 needs to be implemented.

I started adapting the code, but came to find that a simple $response->getContent() just returns an empty string. The real content lies in $response->getComponentParameters() where there is a
Neos\Flow\Http\Component\ReplaceHttpResponseComponent on whose response parameter you can ->getBody()->getContents().
I'm not familiar with this, so I hope someone else can support here.

@kitsunet
Copy link

kitsunet commented Nov 6, 2019

Well technically I woudl say what this does isn't even "allowed" in userland code. I have no spontanous idea how to fix it without using too much internal knowledge. Correct woudl be to run the full HTTP component chain with a fake http request and then grab the response at the end, but I am really not sure how well that will work in a viewhelper inside another active request....

@ComiR
Copy link
Contributor Author

ComiR commented Nov 12, 2019

It's probably not the best solution, but at least it does work with Neos 5.0.
Reviews or better implementations are very welcome!

#18 is included here, because it won't work without.

@ComiR ComiR marked this pull request as ready for review November 12, 2019 11:05
@bweinzierl
Copy link

You changed the internal behaviour to use a Curl-Request to fetch the 404 page right? This has implications with several scenarios (on pages with HTTP Basic Auth or with self signed certificates). Is there no way to use an internal request like before?

@ComiR
Copy link
Contributor Author

ComiR commented Nov 20, 2019

I found a way to use an internal request by using the ComponentChain. That should do the trick.
Is that what you meant in your comment @kitsunet?

@kitsunet
Copy link

yep correct that's what I meant, BUT I am not sure if that messes with security...

@kitsunet
Copy link

Technically we are not 100% setup to run a second http chain separately while one is running already, due to singletons

@kdambekalns
Copy link
Collaborator

The package uses "native 404 handling" by now, problem solved.

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

Successfully merging this pull request may close these issues.

None yet

4 participants