Resume is now done with a Content-Range header instead of a Range header if

the request isn't GET. Presumably, this is how it should be made.
This commit is contained in:
Daniel Stenberg 2001-01-27 18:57:07 +00:00
parent d69302202d
commit 3a8210c975
1 changed files with 15 additions and 2 deletions

View File

@ -429,8 +429,21 @@ CURLcode Curl_http(struct connectdata *conn)
}
}
}
if((data->bits.set_range) && !checkheaders(data, "Range:")) {
data->ptr_rangeline = aprintf("Range: bytes=%s\015\012", data->range);
if(data->bits.set_range) {
/*
* A range is selected. We use different headers whether we're downloading
* or uploading and we always let customized headers override our internal
* ones if any such are specified.
*/
if((data->httpreq == HTTPREQ_GET) &&
!checkheaders(data, "Range:")) {
data->ptr_rangeline = aprintf("Range: bytes=%s\015\012", data->range);
}
else if((data->httpreq != HTTPREQ_GET) &&
!checkheaders(data, "Content-Range:")) {
data->ptr_rangeline = aprintf("Content-Range: bytes=%s\015\012",
data->range);
}
}
if((data->bits.http_set_referer) && !checkheaders(data, "Referer:")) {
data->ptr_ref = aprintf("Referer: %s\015\012", data->referer);