Commit 80ca3d9e authored by mikeytown2's avatar mikeytown2

Issue #2020041 by mikeytown2: Fix Basic Authorization.

parent fd3a4481
......@@ -547,7 +547,7 @@ function httprl_set_connection_flag(&$options, $uri) {
*/
function httprl_handle_data(&$options) {
// Encode data if not already done.
if (!empty($options['data']) && !is_string($options['data'])) {
if (isset($options['data']) && !is_string($options['data'])) {
// No files passed in, url-encode the data.
if (empty($options['data']['files']) || !is_array($options['data']['files'])) {
$options['data'] = http_build_query($options['data'], '', '&');
......@@ -995,6 +995,8 @@ function httprl_request($urls, $options = array()) {
// Use a sync of async connection.
$flags = httprl_set_connection_flag($these_options, $uri);
// Set basic authorization header if needed.
httprl_basic_auth($uri, $these_options);
// If any data is given, do the right things to this request so it works.
httprl_handle_data($these_options);
// Build the request string.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment