[asterisk-bugs] [Asterisk 0018046]: [patch] func_curl CURLOPT likes a querycomponent (+-decoding) hashcompat mode

Asterisk Bug Tracker noreply at bugs.digium.com
Sun Sep 26 12:12:18 CDT 2010


The following issue requires your FEEDBACK. 
====================================================================== 
https://issues.asterisk.org/view.php?id=18046 
====================================================================== 
Reported By:                wdoekes
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   18046
Category:                   Functions/func_curl
Reproducibility:            always
Severity:                   feature
Priority:                   normal
Status:                     feedback
Asterisk Version:           1.6.2.13 
JIRA:                        
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2010-09-24 04:16 CDT
Last Modified:              2010-09-26 12:12 CDT
====================================================================== 
Summary:                    [patch] func_curl CURLOPT likes a querycomponent
(+-decoding) hashcompat mode
Description: 
Hi,

in https://issues.asterisk.org/view.php?id=18037 I've added a QSFIELD
which is pretty much obsoleted by the hashcompat mode of CURLOPT.

However, the ast_uri_decode leaves +'es verbatim in the decoded output,
where I expect them to be decoded to spaces.

The attached patch adds a hashcompat=querycomponent mode that decodes the
pluses properly. (For backwards compatibility the ast_value() works for all
other values.)

Regards,
Walter Doekes
OSSO B.V.
====================================================================== 

---------------------------------------------------------------------- 
 (0127409) tilghman (administrator) - 2010-09-26 12:12
 https://issues.asterisk.org/view.php?id=18046#c127409 
---------------------------------------------------------------------- 
I don't think this is the correct decoding of the '+' character.  RFC 1738
states that the '+' character is reserved, because it MAY be used within
particular URI schemes, but the exact interpretation of the '+' character
is left up to particular URI schemes.  In particular, SIP URIs specify no
particular use of the '+' character and therefore, it SHOULD NOT appear
within an encoded SIP URI.

The only URI specified within RFC 1738 which translates the '+' character
into a space is the Gopher URI, in which it is used to separate search
parameters.  Note that a space encoded as a %20 may still be used in a
Gopher URI, as there is a specific difference between a literal space
within a search string and a '+' character denoting an additional search
parameter.  However, in the generic case, we really should not be making
any assumptions about the use of the '+' character.

Additionally, note the following clause in Section 2.2 of RFC 3986:
"If a reserved character is found in a URI component and no delimiting
role is known for that character, then it must be interpreted as
representing the data octet corresponding to that character's encoding in
US-ASCII."  In other words, a literal '+' character within a SIP URI _MUST_
be interpreted as a literal '+' character, NOT as a space character. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-09-26 12:12 tilghman       Note Added: 0127409                          
2010-09-26 12:12 tilghman       Status                   new => feedback     
======================================================================




More information about the asterisk-bugs mailing list