Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Examples from #1420104: Logic is broken with redirects are still broken:
function httprl_admin_settings_form() {
$headers = array();
$headers['User-Agent'] = 'User-Agent: Drupal (+http://drupal.org/)';
// Add in the headers and enable blocking mode.
$options = array(
'blocking' => TRUE,
'headers' => $headers,
'method' => 'HEAD',
'max_redirects' => 1,
);
// Queue up the requests.
httprl_request('http://jyaml.de', $options);
httprl_request('http://www.jyaml.de', $options);
// Execute requests.
$responses = httprl_send_request();
foreach ($responses as $response) {
krumo($response);
}
// Compare to core:
krumo(drupal_http_request('http://jyaml.de', $options));
krumo(drupal_http_request('http://www.jyaml.de', $options));
Comments
Comment #1
hass CreditAttribution: hass commentedComment #2
hass CreditAttribution: hass commentedDuplicate of #1428484: Improperly formatted HTTP version cause very many malfunctions