[wp-trac] [WordPress Trac] #50491: Loopback request fails if headers set in curl
WordPress Trac
noreply at wordpress.org
Sat Jun 27 23:35:08 UTC 2020
#50491: Loopback request fails if headers set in curl
--------------------------+------------------------------
Reporter: atrixminerva | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: HTTP API | Version: 5.4.2
Severity: normal | Resolution:
Keywords: close | Focuses:
--------------------------+------------------------------
Comment (by atrixminerva):
Confirming session_write_close() fixes the issue if done before the call,
if there are headers being sent.
This code can fix that without modifying anything in the library itself.
Not sure it's useful for fixing it in the end but it's at least much
cleaner:
{{{#!php
<?php
function mymodule_curl_before_request($curlhandle){
session_write_close();
}
add_action( 'requests-curl.before_request','mymodule_curl_before_request',
9999 );
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50491#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list