[reSIProcate] Uri escaping

Jeremy Geras jgeras at counterpath.com
Thu Apr 8 15:59:49 CDT 2010


Hi,

General question:  How should URIs be escaped?

See the attached trace for an example of what we're seeing with resip -- note the Contact header in the NOTIFY, and the subsequent Request-URI in the re-SUBSCRIBE.  Should the URI in the request line be URL-encoded?  (Pouring through the BNF in 3261 leads me to think that it should...)

Note that this is a trace from a deployment where the re-SUBSCRIBE actually fails because of the lack of proper escaping.  I tried making the following change in Uri.cxx, and with that in place the re-SUBSCRIBE works.  However I'm not sure if this is correct, or if this is the right spot.  Thoughts?

Thanks,
Jeremy

// should not encode user parameters unless its a tel?
EncodeStream&
Uri::encodeParsed(EncodeStream& str) const
{
   str << mScheme << Symbols::COLON;
   if (!mUser.empty())
   {
#ifdef HANDLE_CHARACTER_ESCAPING
      //mUser.escapeToStream(str, shouldEscapeUserChar); <== ORIGINAL CODE
      mUser.urlEncode(str);
#else
      str << mUser;
#endif

 ... snip ...


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20100408/3464a21b/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: UriEscaping.pcap
Type: application/octet-stream
Size: 3639 bytes
Desc: UriEscaping.pcap
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20100408/3464a21b/attachment.obj>


More information about the resiprocate-devel mailing list