- Timestamp:
- 2011-11-12T15:49:52Z (13 years ago)
- Branches:
- master
- Children:
- 03a8f8e
- Parents:
- dac74bd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/http_client.c
rdac74bd rdff732d 314 314 } 315 315 316 if( ( req->status_code == 301 || req->status_code == 302) && req->redir_ttl-- > 0 )316 if( ( req->status_code >= 301 && req->status_code <= 303 ) && req->redir_ttl-- > 0 ) 317 317 { 318 318 char *loc, *new_request, *new_host; … … 375 375 going to use strcat(), whether you like it or not. :-) */ 376 376 377 sprintf( new_request, "GET %s HTTP/1.0", url->file ); 378 379 s = strstr( req->request, "\r\n" ); 380 if( s == NULL ) 377 *s = 0; 378 sprintf( new_request, "%s %s HTTP/1.0\r\nHost: %s", 379 req->status_code == 303 || req->request[0] == 'G' ? "GET" : "POST", url->file, url->host ); 380 *s = ' '; 381 382 if( !( ( s = strstr( req->request, "\r\nHost: " ) ) && 383 ( s = strstr( s + strlen( "\r\nHost: " ), "\r\n" ) ) ) ) 381 384 { 382 385 req->status_string = g_strdup( "Error while rebuilding request string" );
Note: See TracChangeset
for help on using the changeset viewer.