Bug discovered with cloudflare worker script
-
Hey guys,
First off, great plugin, makes websites lightning fast. I hope you’ll continue development. I’m here to help a little with that 🙂
I ran into an issue where cloudflare was returning internal error 500 in specific cases, and after many hours of debugging I discovered the cause to be your plugin. If “worker mode” is enabled, then page requests using php functions like file_get_contents or get_headers are going to error, and the reason for this is that these functions do not send an “Accept:” header. It appears that, requests without this accept header are not handled by the cloudflare worker properly.
Use the following commands for your testing:
# no SSL & with an Accept header (200 OK) curl -v -o /dev/null http://mydomain.com/robots.txt -H 'Accept: */*' -H 'Host: mydomain.com' #no SSL & no Accept header (200 OK) curl -v -o /dev/null http://mydomain.com/robots.txt -H 'Accept:' -H 'Host: mydomain.com' # with SSL & with Accept header (200 OK) curl -v -o /dev/null https://mydomain.com/robots.txt -H 'Accept: */*' -H 'Host: mydomain.com' # with SSL & no Accept header (500 internal server error) curl -v -o /dev/null https://mydomain.com/robots.txt -H 'Accept:' -H 'Host: mydomain.com'
The topic ‘Bug discovered with cloudflare worker script’ is closed to new replies.