mirror of
https://github.com/moparisthebest/wget
synced 2024-07-03 16:38:41 -04:00
Detect HTTP Content-Type server encoding
This commit is contained in:
parent
d9cd5d2207
commit
4aab9e8f0a
23
src/http.c
23
src/http.c
@ -2040,9 +2040,32 @@ File %s already there; not retrieving.\n\n"), quote (hs->local_file));
|
||||
char *tmp = strchr (type, ';');
|
||||
if (tmp)
|
||||
{
|
||||
#ifdef ENABLE_IRI
|
||||
char *tmp2 = tmp + 1;
|
||||
#endif
|
||||
|
||||
while (tmp > type && c_isspace (tmp[-1]))
|
||||
--tmp;
|
||||
*tmp = '\0';
|
||||
|
||||
#ifdef ENABLE_IRI
|
||||
if (opt.enable_iri && *tmp2 != '\0' &&
|
||||
(tmp = strstr (tmp2, "charset=")) != NULL)
|
||||
{
|
||||
tmp += 8;
|
||||
tmp2 = tmp;
|
||||
|
||||
while (*tmp2 && !c_isspace (*tmp2))
|
||||
tmp2++;
|
||||
|
||||
if (tmp2 > tmp)
|
||||
{
|
||||
*tmp2 = '\0';
|
||||
/* sXXXav : check given charset */
|
||||
logprintf (LOG_VERBOSE, "HTTP charset: `%s'\n", tmp);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
hs->newloc = resp_header_strdup (resp, "Location");
|
||||
|
Loading…
Reference in New Issue
Block a user