Make WordPress Core


Ignore:
Timestamp:
05/13/2016 05:10:52 AM (9 years ago)
Author:
rmccue
Message:

HTTP API: Add browser compatibility hook for 3xx redirects.

WordPress erroneously follows browser-style behaviour with 3xx redirects, where a POST to 302 becomes a GET. Requests instead follows the specification and keeps the same method. Requests also exposes a hook to allow changing the behaviour.

[37428] used the wrong method of adding this hook, now corrected.

See #33055.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-http.php

    r37428 r37429  
    305305            'useragent' => $r['user-agent'],
    306306            'blocking' => $r['blocking'],
     307            'hooks' => new Requests_Hooks(),
    307308        );
     309
     310        // Ensure redirects follow browser behaviour.
     311        $options['hooks']->register( 'requests.before_redirect', array( get_class(), 'browser_redirect_compatibility' ) );
    308312
    309313        if ( $r['stream'] ) {
Note: See TracChangeset for help on using the changeset viewer.