diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2006-05-26 20:35:16 +0200 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2006-05-26 20:35:16 +0200 |
commit | fe237200e4b3921e190d13693402e14d63fe2fa4 (patch) | |
tree | b240d02687a3046d66148a13e7e54018adfb5ad5 | |
parent | 7deb4471891059edf6000ffc7502a2a7bdc70e78 (diff) |
Always use GET-requests on redirects.
-rw-r--r-- | protocols/http_client.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/protocols/http_client.c b/protocols/http_client.c index 88aadff3..c793d9d4 100644 --- a/protocols/http_client.c +++ b/protocols/http_client.c @@ -374,19 +374,7 @@ got_reply: /* So, now I just allocated enough memory, so I'm going to use strcat(), whether you like it or not. :-) */ - /* First, find the GET/POST/whatever from the original request. */ - s = strchr( req->request, ' ' ); - if( s == NULL ) - { - req->status_string = g_strdup( "Error while rebuilding request string" ); - g_free( new_request ); - g_free( url ); - goto cleanup; - } - - *s = 0; - sprintf( new_request, "%s %s HTTP/1.0\r\n", req->request, url->file ); - *s = ' '; + sprintf( new_request, "GET %s HTTP/1.0", url->file ); s = strstr( req->request, "\r\n" ); if( s == NULL ) @@ -397,7 +385,7 @@ got_reply: goto cleanup; } - strcat( new_request, s + 2 ); + strcat( new_request, s ); new_host = g_strdup( url->host ); new_port = url->port; new_proto = url->proto; |