X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=loadcfg.c;h=88379eb52797f5a64c15492df6fa14ecb8a7afbd;hp=eac9206a811378fa46625baf9a3636ee8aac8d44;hb=9fd58c0d3a56323ce94837f217e6609e9c7b2402;hpb=96bf13e8606919027cc3dc3597627396b9e55a0a diff --git a/loadcfg.c b/loadcfg.c index eac9206a..88379eb5 100644 --- a/loadcfg.c +++ b/loadcfg.c @@ -141,6 +141,7 @@ static struct file_list *current_configfile = NULL; #define hash_compression_level 2464423563U /* "compression-level" */ #define hash_confdir 1978389U /* "confdir" */ #define hash_connection_sharing 1348841265U /* "connection-sharing" */ +#define hash_cors_allowed_origin 2769345637U /* "cors-allowed-origin" */ #define hash_debug 78263U /* "debug" */ #define hash_default_server_timeout 2530089913U /* "default-server-timeout" */ #define hash_deny_access 1227333715U /* "deny-access" */ @@ -647,6 +648,7 @@ struct configuration_spec * load_config(void) config->compression_level = 1; #endif config->feature_flags &= ~RUNTIME_FEATURE_TOLERATE_PIPELINING; + config->cors_allowed_origin = NULL; configfp = fopen(configfile, "r"); if (NULL == configfp) @@ -881,6 +883,18 @@ struct configuration_spec * load_config(void) break; #endif +/* ************************************************************************* + * cors-allowed-origin http://www.example.org + * *************************************************************************/ + case hash_cors_allowed_origin : + /* + * We don't validate the specified referrer as + * it's only used for string comparison. + */ + freez(config->cors_allowed_origin); + config->cors_allowed_origin = strdup_or_die(arg); + break; + /* ************************************************************************* * debug n * Specifies debug level, multiple values are ORed together.