[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 14:29:04 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
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 14:29 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.
====================================================================== 

---------------------------------------------------------------------- 
 (0127411) wdoekes (reporter) - 2010-09-26 14:29
 https://issues.asterisk.org/view.php?id=18046#c127411 
---------------------------------------------------------------------- 
Your criticism is misdirected. I do not propose to replace ast_uri_decode()
with my version (that would indeed break SIP). I only propose to _add_ the
"query component" mode (RFC2396 3.4) to the CURL return value decoding
options. (Look at the patch.)

> In other words, a literal '+' character within a SIP URI _MUST_ be
> interpreted as a literal '+' character, NOT as a space character.

I'm all with you. But we're not talking about SIP URIs here, per se. We're
talking about user data retrieved through CURL.

My problem is the following: my customer wants to interface with its
customers using a simple interface. Give the customer a list of key-value
pairs (HTTP GET query string) and have them reply with an equally simple
set of key-value pairs. These customers will expect to run some kind of
urlencode() in their favorite web programming language on their dictionary
of return values, and that function will generally be replacing spaces with
pluses (standard application/x-www-form-urlencoded rules). And I would
agree with them that that's logical. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-09-26 14:29 wdoekes        Note Added: 0127411                          
======================================================================




More information about the asterisk-bugs mailing list