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

NiceSearchModule: aborting with incomplete response #15

Open
RafaelKr opened this issue Jul 30, 2024 · 0 comments
Open

NiceSearchModule: aborting with incomplete response #15

RafaelKr opened this issue Jul 30, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@RafaelKr
Copy link

Version

1.0.2

What did you expect to happen?

Searching with nice-search enabled should redirect me to the correct path.

What actually happens?

My FastCGI based webserver returned a response with the correct Location header, but status code 200. This leads to a blank page instead of the expected redirect.

I'm using caddy and the logs showed: aborting with incomplete response

Steps to reproduce

  1. Use caddy with the php_fastcgi directive with the following (simplified) configuration:
{
  # Prevents binding to port 80 which would need root privileges
	auto_https disable_redirects
}

https://example.localhost:8443 {
  handle /bud/* {
    reverse_proxy http://localhost:4000
  }

  root * public

  encode zstd gzip

  php_fastcgi "unix//run/php/php8.2-fpm.sock"

  file_server
}

Also every other reverse proxy with fastcgi should work.

  1. Do a search

Workaround

I can fix it by going to

and replace the exit; with

if (function_exists('fastcgi_finish_request')) {
    fastcgi_finish_request();
} else {
    exit;
}

This is how Symfony is handling this (also Laravel uses the same Symfony component):
https://github.com/symfony/symfony/blob/5938c51403b567fca54ef758071f54622475f141/src/Symfony/Component/HttpFoundation/Response.php#L392

And this is the WordPress wp_die() function: https://github.com/WordPress/wordpress-develop/blob/dfd1de09afbb5b3c4c7a959b20a1f5fa7011aa46/src/wp-includes/functions.php#L3717

System info

Linux Mint 21.3 with https://devenv.sh/ which is based on the nix package manager.

Log output

No response

Please confirm this isn't a support request.

Yes

@RafaelKr RafaelKr added the bug Something isn't working label Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant