Support » Plugin: WP REST Cache » Headers duplicates

  • Resolved dovich

    (@dovich)


    In https://wordpress.org/support/plugin/wp-rest-cache/ line 361

    rest_send_cors_headers() actually duplicates the headers set in my nginx config. Need some option on dashboard to prevent sending headers from plugin.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Richard Korthuis

    (@rockfire)

    Hi @dovich

    Thank you for using our plugin!

    The rest_send_cors_headers() function is an almost exact copy of the same function from the WordPress core (wp-includes/rest-api.php). So if you are having problems with our plugin I would think you would also have problems when using the default REST API provided by WordPress? And if so I would say it is a problem with your nginx configuration?
    Could you confirm you are having the same problems when not using our plugin?

    Thread Starter dovich

    (@dovich)

    Hi, Richard.

    Thank you for your plugin!

    I completely forgot tell you about a “little” detail – default WP rest headers is disbled, and it’s possible directly from my code: remove_filter( 'rest_pre_serve_request', 'rest_send_cors_headers' );

    So there is no problem with my nginx configuration, and all headers are controled by nginx (production necessity).

    I just asked you about the possibility to somehow disable sending headers in your plugin – be it a filter or an option in the admin panel.

    Thank you.

    Plugin Author Richard Korthuis

    (@rockfire)

    Hi @dovich

    Sorry for the late reply.

    Ok, that is clear. We will add a filter in our next release, allowing you to disable the sending of the CORS headers (wp_rest_cache/disable_cors_headers).

    Thread Starter dovich

    (@dovich)

    Thank You!

    Plugin Author Richard Korthuis

    (@rockfire)

    Hi @dovich

    Sorry, it took a bit longer than intended, but we just released a new version of our plugin which includes the mentioned filter.

    Thread Starter dovich

    (@dovich)

    Thank you, Richard. I really appreciate your work.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.