80f55de280d3cc483b772c1d02dd88b6bc1cf173 max Thu Oct 16 03:01:55 2025 -0700 adding an apache logfile line when apiKey is recognized, refs #36428 diff --git src/hg/lib/cart.c src/hg/lib/cart.c index 14cd37aee1b..f53e0c2c84f 100644 --- src/hg/lib/cart.c +++ src/hg/lib/cart.c @@ -1470,30 +1470,31 @@ { char *url = "https://challenges.cloudflare.com/turnstile/v0/siteverify"; char *secret = cfgVal("cloudFlareSecretKey"); if (!secret) errAbort("'cloudFlareSecretKey' must be set in hg.conf if cloudflare is activated in hg.conf"); char data[3000]; // cloudflare token is at most 2000 bytes safef(data, sizeof(data), "secret=%s&response=%s", secret, token); char *reply = curlPostUrl(url, data); boolean res = strstr(reply, "\"success\":true") != NULL; freez(&reply); return res; } +// hg.conf key with the cloud flare secret key, used twice here, so a global macro #define CLOUDFLARESITEKEY "cloudFlareSiteKey" void printCaptcha() /* print an html page that shows the captcha and on success, reloads the page with the token added as token=x */ { char *cfSiteKey = cfgVal(CLOUDFLARESITEKEY); if (!cfSiteKey) return; puts("Content-Type:text/html\n"); // puts outputs one newline. Header requires two newlines. puts("
"); puts("