The curlExec() handles redirects itself, but in doing so it ignores the simpletest_remote_url setting. I think all that needs to be done is to change this:


$curl_options[CURLOPT_URL] = $this->drupalGetHeader('location');

To this:


$curl_options[CURLOPT_URL] = $this->getAbsoluteUrl((string) $this->drupalGetHeader('location'));

Does this look right to anyone else?

Comments

RoloDMonkey’s picture

Actually, we don't even need the forced-type:


$curl_options[CURLOPT_URL] = $this->getAbsoluteUrl($this->drupalGetHeader('location'));

RoloDMonkey’s picture

Assigned: Unassigned » RoloDMonkey
RoloDMonkey’s picture

Status: Active » Needs review

How do I submit a 'patch' for this branch? I believe this is ready to go.

boombatower’s picture

You can role patches against the CVS and I'll apply them against the git and commit to cvs as well. If you want to clone git repository and patch against that would also work.

Perhaps you can submit a test case that show this fail and then get corrected with patch. If you don't want to make up official test a simple example that we can use to confirm would be handy.

chx’s picture

This looks incorrect to me , redirects are supposed to be absolute URLs. If you are seeing a site-relative redirect that's the bug. "HTTP/1.1 requires an absolute URI as argument to » Location: including the scheme, hostname and absolute path, but some clients accept relative URIs. "