diff --git a/README.md b/README.md index c54472b..09f36b6 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ server { js_challenge_html /path/to/body.html; js_challenge_bucket_duration 3600; js_challenge_title "Verifying your browser..."; + js_challenge_whitelist /path/to/whitelist/file.conf; location /static { js_challenge off; @@ -57,6 +58,7 @@ server { * `js_challenge_html "/path/to/file.html"` Path to html file to be inserted in the `` tag of the interstitial page * `js_challenge_title "title"` Will be inserted in the `` tag of the interstitial page. DEFAULT: "Verifying your browser..." * `js_challenge_bucket_duration time` Interval to prompt js challenge, in seconds. DEFAULT: 3600 +* `js_challenge_whitelist "/path/to/whitelist/file.conf"` Path to conf file containing whitelisted hosts and networks ### Installation diff --git a/ngx_http_js_challenge.c b/ngx_http_js_challenge.c index b0f375c..a7e9de4 100644 --- a/ngx_http_js_challenge.c +++ b/ngx_http_js_challenge.c @@ -27,7 +27,7 @@ #define DEFAULT_TITLE "Verifying your browser..." -#define WHITELIST_MAX_LENGTH 256 +#define WHITELIST_MAX_LENGTH 1024 typedef struct { @@ -219,7 +219,7 @@ static size_t load_whitelist( const char* file, network_info_t* list, size_t max } - } while ((token = strtok(NULL, ";")) != NULL); + } while (len < WHITELIST_MAX_LENGTH && ((token = strtok(NULL, ";")) != NULL)); } free(linebuf);