Add option to set Accept-Charset header (Stefaan Claes)
svn path=/trunk/netsurf/; revision=3124
This commit is contained in:
parent
abcce3dfe7
commit
98b451ffae
|
@ -431,6 +431,14 @@ struct fetch * fetch_start(char *url, char *referer,
|
|||
APPEND(fetch->headers, s);
|
||||
}
|
||||
|
||||
if (option_accept_charset) {
|
||||
char s[80];
|
||||
snprintf(s, sizeof s, "Accept-Charset: %s, *;q=0.1",
|
||||
option_accept_charset);
|
||||
s[sizeof s - 1] = 0;
|
||||
APPEND(fetch->headers, s);
|
||||
}
|
||||
|
||||
/* And add any headers specified by the caller */
|
||||
for (i = 0; headers[i]; i++) {
|
||||
if (strncasecmp(headers[i], "If-Modified-Since:", 18) == 0) {
|
||||
|
|
|
@ -67,6 +67,8 @@ char *option_font_cursive;
|
|||
char *option_font_fantasy;
|
||||
/** Accept-Language header. */
|
||||
char *option_accept_language = 0;
|
||||
/** Accept-Charset header. */
|
||||
char *option_accept_charset = 0;
|
||||
/** Preferred maximum size of memory cache / bytes. */
|
||||
int option_memory_cache_size = 2 * 1024 * 1024;
|
||||
/** Preferred expiry age of disc cache / days. */
|
||||
|
@ -149,6 +151,7 @@ struct {
|
|||
{ "font_cursive", OPTION_STRING, &option_font_cursive },
|
||||
{ "font_fantasy", OPTION_STRING, &option_font_fantasy },
|
||||
{ "accept_language", OPTION_STRING, &option_accept_language },
|
||||
{ "accept_charset", OPTION_STRING, &option_accept_charset },
|
||||
{ "memory_cache_size", OPTION_INTEGER, &option_memory_cache_size },
|
||||
{ "disc_cache_age", OPTION_INTEGER, &option_disc_cache_age },
|
||||
{ "block_advertisements", OPTION_BOOL, &option_block_ads },
|
||||
|
|
|
@ -40,6 +40,7 @@ extern char *option_http_proxy_auth_pass;
|
|||
extern int option_font_size;
|
||||
extern int option_font_min_size;
|
||||
extern char *option_accept_language;
|
||||
extern char *option_accept_charset;
|
||||
extern int option_memory_cache_size;
|
||||
extern int option_disc_cache_age;
|
||||
extern bool option_block_ads;
|
||||
|
|
Loading…
Reference in New Issue