9ae100f68581af8c1a38dab93954173ef2f76254
max
  Tue Jun 24 01:32:21 2025 -0700
captcha user-agent exceptions are defined in hg.conf, refs #35790

diff --git src/hg/lib/hgConfig.c src/hg/lib/hgConfig.c
index 6e041bc01c1..bb83ef02386 100644
--- src/hg/lib/hgConfig.c
+++ src/hg/lib/hgConfig.c
@@ -326,30 +326,50 @@
 /* get list of names in config file that start with prefix. slFreeList when finished */
 {
 if(cfgOptionsHash == NULL)
     initConfig();
 struct slName *names = NULL;
 struct hashCookie cookie = hashFirst(cfgOptionsHash);
 struct hashEl *hel;
 while ((hel = hashNext(&cookie)) != NULL) 
     {
     if (startsWith(prefix, hel->name)) 
         slSafeAddHead(&names, slNameNew(hel->name));
     }
 return names;
 }
 
+struct slName *cfgValsWithPrefix(char* prefix)
+/* get list of values in config file with prefix. slFreeList when finished */
+{
+struct slName *prefNames = cfgNamesWithPrefix(prefix);
+if (!prefNames)
+    return NULL;
+
+struct slName *prefVals = NULL;
+
+for (struct slName *sl = prefNames;  sl != NULL;  sl = sl->next)
+    {
+    char * val = cfgVal(sl->name);
+    struct slName *slValName = slNameNew(val); // cannot re-use the val string, must malloc it again, sl->name is char[1]
+    slAddHead(&prefVals, slValName);
+    }
+
+slNameFreeList(&prefNames);
+return prefVals;
+}
+
 unsigned long cfgModTime()
 /* Return modification time of config file */
 {
 char filename[PATH_LEN];
 getConfigFile(filename);
 return fileModTime(filename);
 }
 
 void cfgSetMaxMem()
 /* Check hg.conf for maxMem.  If not set, don't limit memory.  Otherwise
  * limit memory usage to that number. */
 {
 char *maxMemStr = NULL;
 
 if ((maxMemStr = cfgOption("maxMem")) != NULL)