1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00

Fixes bug #669059. We now extract the Content-Type better and more accurate.

This commit is contained in:
Daniel Stenberg 2003-01-30 05:04:02 +00:00
parent f81d027f60
commit 169b2eeb94

View File

@ -567,10 +567,16 @@ CURLcode Curl_readwrite(struct connectdata *conn,
*start && isspace((int)*start); *start && isspace((int)*start);
start++); start++);
/* count all non-space letters following */ end = strchr(start, '\r');
for(end=start, len=0; if(!end)
*end && !isspace((int)*end); end = strchr(start, '\n');
end++, len++);
if(end) {
/* skip all trailing space letters */
for(; isspace(*end) && (end > start); end--);
/* get length of the type */
len = end-start+1;
/* allocate memory of a cloned copy */ /* allocate memory of a cloned copy */
if(data->info.contenttype) if(data->info.contenttype)
@ -584,6 +590,7 @@ CURLcode Curl_readwrite(struct connectdata *conn,
memcpy(data->info.contenttype, start, len); memcpy(data->info.contenttype, start, len);
data->info.contenttype[len] = 0; /* zero terminate */ data->info.contenttype[len] = 0; /* zero terminate */
} }
}
else if((k->httpversion == 10) && else if((k->httpversion == 10) &&
conn->bits.httpproxy && conn->bits.httpproxy &&
Curl_compareheader(k->p, Curl_compareheader(k->p,