DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40831>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40831

           Summary: RewriteMap empty value behaves differently from
                    documentation
           Product: Apache httpd-2
           Version: 2.3-HEAD
          Platform: Other
               URL: http://httpd.apache.org/docs/2.3/mod/mod_rewrite.html#re
                    writemap
        OS/Version: other
            Status: NEW
          Severity: minor
          Priority: P2
         Component: Documentation
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


The RewriteMap documentation says:

   ${ MapName :  LookupKey }
   ${ MapName : LookupKey | DefaultValue }

   When such a construct occurs, the map MapName is consulted and the key 
   LookupKey is looked-up. If the key is found, the map-function construct is 
   substituted by SubstValue. If the key is not found then it is substituted by 
   DefaultValue or by the empty string if no DefaultValue was specified.

If the lookup succeeds, but the map contains no value for the given key (a line
with only a key, or a key followed by whitespace), this is treated as though the
key were absent entirely.  The documentation suggests that this "no value"
situation should result in an empty string expansion, not DefaultValue, when in
fact, the DefaultValue is used instead.

It would actually be kind of nice if it expanded to an empty string (thus making
the situation where a key is present but without a value significantly different
from a situation where a key is absent), but I'm fine with a documentation
fix/clarification, perhaps something like this:

   When such a construct occurs, the map MapName is consulted and the key 
   LookupKey is looked-up. If the key is found and has a non-empty value, the 
   map-function construct is substituted by SubstValue. If the key is not found 
   or is found but has no value, then it is substituted by DefaultValue or by 
   the empty string if no DefaultValue was specified.

And perhaps even with this note:

   It is not possible to distinguish between a key present in the map but
   without a value from a key missing from the map entirely.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to