-
-
Notifications
You must be signed in to change notification settings - Fork 242
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
No output in latest version #177
Comments
Ok, red herring. Here's the minimal reproduction case, no output is sent to the browser: <?PHP
echo 'hello world';
flush();
// never executes
throw new LogicException('expected unhandled exception'); |
There's very clearly a test case for this in the repo and it works. After digging a little deeper when I removed:
from my Dockerfile, it magically started working as it did before. So now I'm trying to figure out which ini setting causes it to misbehave. |
Looks like if there is output buffering, a |
When adding some logging to flusher, ok := fc.responseWriter.(http.Flusher)
if !ok {
fc.Logger.Info("response writer is not a flusher")
return true
} I get the output:
|
But why did it work on an earlier version?? |
Potentially a bug with caddy 2.6 vs. 2.7? |
Maybe related to caddyserver/caddy#5509? |
It's not related to caddyserver/caddy#5509 after all. The problem is that if the I don't know if this changed in Caddy 2.7, and if it's expected. Maybe @mholt has a hint about this? |
To be sure, are you using Caddy 2.7.3? |
2.7.2 until #178 is merged, but I just tested and the problem also exists in 2.7.3. |
I cannot check right now but it's probably related to the ordering because with FrankenPHP using an ordered route is mandatory. @withinboredom could you try putting the log directive last? |
The log directive isn't an HTTP handler directive, it sets up server-level config. Ordering is not the problem. I think it does have to do with ResponseController stuff. Was the PHP handler updated to use ResponseController to call Flush()? It would need to, to unwrap the underlying flusher. |
@dunglas I wish that were the case, but I think it's unlikely, since Edit: Oh, did we have a breaking change? Handlers can't just call |
Yeah, https://github.com/dunglas/frankenphp/blob/main/frankenphp.go#L568 needs to be updated to use ResponseController I think. It's because of caddyserver/caddy#5654 which means our response writer isn't directly a flusher anymore and you need to use the response controller to flush now. This should work:
|
Sorry. I didn't realize this was a breaking change. 😖 |
I don't have a simple reproduction case, but this causes nothing to be output when deep in the stack:
If and only if those two conditions are on the same line (and if-statement) does it cause all output to cease functioning. Breaking them up into multiple if-statements is enough to allow processing to continue.
I'll bisect and try to hunt down the specific version this broke in. All I know is that it wasn't broken in
The text was updated successfully, but these errors were encountered: