coar 98/07/10 05:58:56
Modified: src CHANGES src/modules/standard mod_setenvif.c Log: Make mod_setenvif work like mod_rewrite - namely, let it use "^$" to match missing fields. Revision Changes Path 1.957 +3 -0 apache-1.3/src/CHANGES Index: CHANGES =================================================================== RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.956 retrieving revision 1.957 diff -u -r1.956 -r1.957 --- CHANGES 1998/07/09 20:37:12 1.956 +++ CHANGES 1998/07/10 12:58:54 1.957 @@ -1,5 +1,8 @@ Changes with Apache 1.3.1 + *) mod_setenvif (BrowserMatch* and friends) will now match a missing + field with "^$". [Ken Coar] + *) Cache a proxied request in the event that the client cancels the transfer, provided that the configured percentage of the file has already been transfered. It works for http transfers only. The 1.25 +10 -3 apache-1.3/src/modules/standard/mod_setenvif.c Index: mod_setenvif.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_setenvif.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- mod_setenvif.c 1998/07/10 00:54:17 1.24 +++ mod_setenvif.c 1998/07/10 12:58:56 1.25 @@ -163,7 +163,8 @@ } /* any non-NULL magic constant will do... used to indicate if REG_ICASE should - * be used */ + * be used + */ #define ICASE_MAGIC ((void *)(&setenvif_module)) static const char *add_setenvif_core(cmd_parms *cmd, void *mconfig, @@ -360,8 +361,14 @@ } } - if (!val) { - continue; + /* + * A NULL value indicates that the header field or special entity + * wasn't present or is undefined. Represent that as an empty string + * so that REs like "^$" will work and allow envariable setting + * based on missing or empty field. + */ + if (val == NULL) { + val = ""; } if (!regexec(b->preg, val, 0, NULL, 0)) {