< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index  

Re: [reSIProcate-users] Why is '%2F' being un-escaped?


Hmm, there appears to be a conflict between 3261 and 2396. '/' is allowed in the userinfo defined in RFC 3261.

Best regards,
Byron Campen

Hi,

I have this piece of code:

 std::string requestUri("sip:test%2Ftest@xxxxxxxxxx:5060");
 resip::NameAddr targetUri;
 targetUri = resip::NameAddr(requestUri.c_str());
 ::sprintf(stderr, "targetUri: \"%s\"",
targetUri.uri().toString().c_str());

When I execute it, I found that the output is
"sip:test/test@xxxxxxxxxx:5060". I am surprised that it automatically
decode "%2F" and convert it to '/'.

I investigated the code resip/stack/Uri.cxx, it is because of these few
lines of code in Uri::parse():

  if (!pb.eof())
  {
     pb.reset(start);
     start = pb.position();
     pb.skipToOneOf(":@");
#ifdef HANDLE_CHARACTER_ESCAPING
     pb.dataUnescaped(mUser, start);
#else
     pb.data(mUser, start);
#endif

As I understand from RFC2396 section 3.2.2, '/' is not one of the
allowed characters in the userinfo component, so why does the resip code
un-escape "%2F" to '/' but does not escape it back?

Thank you very much for your time.

Regards,
Kok Meng, Wong


_______________________________________________
resiprocate-users mailing list
resiprocate-users@xxxxxxxxxxxxxxx
List Archive: http://list.resiprocate.org/archive/resiprocate-users/

Attachment: smime.p7s
Description: S/MIME cryptographic signature