I get "Notice: Undefined offset: 1 in drupal_http_request()" errors, and a response code of zero, for URLs being checked on some servers like:

http://www.adviceguide.org.uk/
http://www.citizensadvice.org.uk/index/policy.htm

Both running Microsoft-IIS/6.0 powered by ASP.NET

A quick look in drupal_http_request() shows that the function is not getting any $response from the server, so it can't find the headers to get the response status. This function does some pretty complicated stuff for D7, that I don't have time to debug at the moment.

The sites do return correct headers when those URLs are requested in a browser. Will investigate further when I get time.

Comments

fonant’s picture

Title: Undefined offsets in drupal_http_request() for some web servers » Undefined offset in drupal_http_request() for some web servers

Improved title of issue to match potential search words.

fonant’s picture

Priority: Normal » Minor

OK, changing the link settings from the broken links report to use GET instead of HEAD fixes the problem.

So the external server presumably doesn't respond to HEAD requests correctly, or responds in a way that drupal_http_request() understands.

hass’s picture

Project: Link checker » Drupal core
Version: 7.x-1.x-dev » 7.10
Component: Code » base system
Priority: Minor » Normal

Than it's a core bug.

ComboPrime’s picture

Version: 7.10 » 7.12

Getting this error on a number of admin pages (Appearance - List, Available Updates - List, etc.) after upgrading from Core 7.10 to Core 7.12:

Notice: Undefined offset: 1 in drupal_http_request() (line 926 of ...\includes\common.inc).
Notice: Undefined offset: 2 in drupal_http_request() (line 930 of ...\includes\common.inc).
Notice: Undefined offset: 1 in drupal_http_request() (line 930 of ...\includes\common.inc).

Running IIS7 here. Any help appreciated! Thanks,

ComboPrime

brentratliff’s picture

I get the same notices on the same lines running PHP 5.2 with Apache in D7.12.

areikiera’s picture

@Fonant,

I don't see your suggestion (repeated below) in the settings for Link Checker. How would I do that?

OK, changing the link settings from the broken links report to use GET instead of HEAD fixes the problem.

Thanks!

hass’s picture

See link settings next to the link reported as broken.

mgifford’s picture

Status: Active » Closed (duplicate)

I'm pretty sure this is a duplicate of #924498: Proxy https support for drupal_http_request()