• Resolved MrBrian

    (@mrbrian)


    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' 
    • This topic was modified 5 years, 6 months ago by MrBrian.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor iSaumya

    (@isaumya)

    Hi @mrbrian,
    Thanks for your message. Actually, I’ve rewritten the worker code for the upcoming release which I do not think will have this problem. Let’s wait for that to be released and then let me know if you still face the issue then.

    Plugin Contributor Salvatore Fresta

    (@salvatorefresta)

    Thank you, the new version of the plugin will be released asap 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Bug discovered with cloudflare worker script’ is closed to new replies.