You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2006/10/27 19:10:35 UTC

DO NOT REPLY [Bug 40831] New: - RewriteMap empty value behaves differently from documentation

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: bugs@httpd.apache.org
        ReportedBy: david+apache@fastolfe.net


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: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 40831] - RewriteMap empty value behaves differently from documentation

Posted by bu...@apache.org.
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





------- Additional Comments From david+apache@fastolfe.net  2006-10-27 10:38 -------
To clarify, I was testing with the text map type.  It might be nice to see if
this behavior is the same across other types of maps before making any changes.

-- 
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: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org