curl-library
disabling non-existant POST
Date: Mon, 15 Apr 2002 13:28:14 +0200
"curl -v -L -I www.macfixit.com" displays "Disables POST, goes with GET" which
is quite misleading. The first request didn't use POST (it used HEAD), and the
second request doesn't use GET (it uses HEAD). I believe this patch fixes this.
--- transfer.c Wed Apr 10 13:44:42 2002
+++ transfer_patched.c Mon Apr 15 13:13:49 2002
@@ -1291,8 +1291,11 @@
case 303: /* See Other */
/* Disable both types of POSTs, since doing a second POST when
* following isn't what anyone would want! */
- data->set.httpreq = HTTPREQ_GET; /* enforce GET request */
- infof(data, "Disables POST, goes with GET\n");
+ if(data->set.httpreq != HTTPREQ_GET) {
+ data->set.httpreq = HTTPREQ_GET; /* enforce GET request */
+ infof(data, "Disables POST, goes with %s\n",
+ data->set.no_body?"HEAD":"GET");
+ }
break;
case 304: /* Not Modified */
/* 304 means we did a conditional request and it was "Not modified".
Received on 2002-04-15