Branch: Tag:


2016-06-16 13:46:13 by Henrik Grubbström (Grubba) <>

RXML: &; should evaluate to RXML.nil when no post-data.

The HTTP protocol module has a tendency to set data to "" (and not to 0),
even when no data was submitted with the request. Detect this case by
checking whether id->misc->len has been set (ie a Content-Length header
was received).

Fixes [bug 7721 (#7721)].

3701:   {    // Some common cases.    if (!id->data) return 0; +  if (zero_type(id->misc->len)) return 0;    if (id->data == "") return "";    return Crypto.SHA1.hash(id->data);   }
3739:    case "url": return ENCODE_RXML_TEXT(c->id->raw_url, type);    case "post-data":    c->id->register_vary_callback(0, hash_query_data); -  return c->id->data ? ENCODE_RXML_TEXT(c->id->data, type) : RXML.nil; +  if (!c->id->data || zero_type(c->id->misc->len)) return RXML.nil; +  return ENCODE_RXML_TEXT(c->id->data, type);    case "last-true": return ENCODE_RXML_INT(c->misc[" _ok"], type);    case "language": return ENCODE_RXML_TEXT(c->misc->language, type);    case "scope": return ENCODE_RXML_TEXT(c->current_scope(), type);