Title: Bug discovered with cloudflare worker script
Last modified: November 22, 2020

---

# Bug discovered with cloudflare worker script

 *  Resolved [MrBrian](https://wordpress.org/support/users/mrbrian/)
 * (@mrbrian)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/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' 
       ```
   
    -  This topic was modified 5 years, 6 months ago by [MrBrian](https://wordpress.org/support/users/mrbrian/).

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

 *  Plugin Contributor [iSaumya](https://wordpress.org/support/users/isaumya/)
 * (@isaumya)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/bug-discovered-with-cloudflare-worker-script/#post-13696308)
 * Hi [@mrbrian](https://wordpress.org/support/users/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](https://wordpress.org/support/users/salvatorefresta/)
 * (@salvatorefresta)
 * [5 years, 6 months ago](https://wordpress.org/support/topic/bug-discovered-with-cloudflare-worker-script/#post-13711266)
 * 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.

 * ![](https://ps.w.org/wp-cloudflare-page-cache/assets/icon-256x256.gif?rev=3234997)
 * [Super Page Cache – Cloudflare Cache, Page Speed & Core Web Vitals](https://wordpress.org/plugins/wp-cloudflare-page-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-cloudflare-page-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-cloudflare-page-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-cloudflare-page-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-cloudflare-page-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-cloudflare-page-cache/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [Salvatore Fresta](https://wordpress.org/support/users/salvatorefresta/)
 * Last activity: [5 years, 6 months ago](https://wordpress.org/support/topic/bug-discovered-with-cloudflare-worker-script/#post-13711266)
 * Status: resolved