WordPress.org

Make WordPress Core

Ticket #47962: 47962.patch

File 47962.patch, 517 bytes (added by imath, 2 years ago)
  • src/js/_enqueues/wp/api-request.js

    diff --git src/js/_enqueues/wp/api-request.js src/js/_enqueues/wp/api-request.js
    index 3ed1c68695..045f4eb985 100644
     
    6969                        }
    7070                }
    7171
    72                 if ( addNonceHeader ) {
     72                // Force the addiction of the nonce header for self requests only.
     73                if ( addNonceHeader && -1 !== url.indexOf( wpApiSettings.root ) ) {
    7374                        // Do not mutate the original headers object, if any.
    7475                        headers = $.extend( {
    7576                                'X-WP-Nonce': wpApiSettings.nonce