On my system (libcurl 7.18.0-1ubuntu2), drupalGet does not work correctly: it issues POST requests instead of GET. For example, this access log from a Forum test case:
127.0.1.1 - - [01/Jul/2008:02:07:35 +0200] "POST /CoreDev/DRUPAL-7/node/1 HTTP/1.1" 200 6558 "-" "simpletest994906"
127.0.1.1 - - [01/Jul/2008:02:07:36 +0200] "POST /CoreDev/DRUPAL-7/node/1 HTTP/1.1" 200 6558 "-" "simpletest994906"
127.0.1.1 - - [01/Jul/2008:02:07:36 +0200] "POST /CoreDev/DRUPAL-7/node/1 HTTP/1.1" 200 6558 "-" "simpletest994906"
127.0.1.1 - - [01/Jul/2008:02:07:36 +0200] "POST /CoreDev/DRUPAL-7/node/2 HTTP/1.1" 200 6693 "-" "simpletest994906"
127.0.1.1 - - [01/Jul/2008:02:07:36 +0200] "POST /CoreDev/DRUPAL-7/node/2 HTTP/1.1" 200 6693 "-" "simpletest994906"
127.0.1.1 - - [01/Jul/2008:02:07:37 +0200] "POST /CoreDev/DRUPAL-7/node/2 HTTP/1.1" 200 6693 "-" "simpletest994906"
127.0.1.1 - - [01/Jul/2008:02:07:37 +0200] "POST /CoreDev/DRUPAL-7/node/3 HTTP/1.1" 200 6693 "-" "simpletest994906"
127.0.1.1 - - [01/Jul/2008:02:07:37 +0200] "POST /CoreDev/DRUPAL-7/node/3 HTTP/1.1" 200 6693 "-" "simpletest994906"
127.0.1.1 - - [01/Jul/2008:02:07:37 +0200] "POST /CoreDev/DRUPAL-7/node/3 HTTP/1.1" 200 6693 "-" "simpletest994906"
Looks like we need to use CURLOPT_HTTPGET to reset the internal state of the curl library (the enclosed patch does that).
Can someone confirm this bugs with others versions of libcurl?
Comments
Comment #1
damien tournoud commentedOh, and note that this broke my Block caching tests in #235673: Changes to block caching mode not caught.
Comment #2
chx commentedthen, i believe the curlopt_post => FALSE is not necessary. Damien thanks for this i remember trying to find exactly this but i failed. i am happy someone else did not :)
Comment #3
damien tournoud commentedI also believe curl doesn't need the reset of POSTFIELDS. Untested patch.
Comment #4
catchRan all tests with #3, no new failures.
Comment #5
chx commentedYay for less and cleaner code.
Comment #6
dries commentedCommitted to CVS HEAD. Thanks.
Comment #7
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.