[asterisk-bugs] [JIRA] (ASTERISK-28825) Any curl response checks out as valid even if 404 is returned.

dovid (JIRA) noreply at issues.asterisk.org
Mon Apr 13 12:58:26 CDT 2020


dovid created ASTERISK-28825:
--------------------------------

             Summary: Any curl response checks out as valid even if 404 is returned.
                 Key: ASTERISK-28825
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-28825
             Project: Asterisk
          Issue Type: Bug
      Security Level: None
          Components: Functions/func_curl
    Affects Versions: 16.6.1
         Environment: CentOS7, Asterisk 16.6.1
            Reporter: dovid
            Severity: Minor


Hi,

In acf_curl_helper if there is any response then ret gets set to 0. This is the case regardless if the http response code that is sent back is a 200, 404 etc. It seems to be under if (args->cb_data.str && ast_str_strlen(args->cb_data.str)) {

For instance if the response is:
'<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /moh.php/single was not found on this server.</p>
</body></html>'

then Asterisk thinks the response was valid. If I do a curl request direct from the Linux CLI it looks like this

[root at a2-c2-nyc2 asterisk-16.6.1]# curl -I  http://localhost/moh.php
HTTP/1.1 404 Not Found
Date: Mon, 13 Apr 2020 17:55:50 GMT
Server: Apache/2.4.6 (CentOS) PHP/7.0.30
Content-Type: text/html; charset=iso-8859-1

[root at a2-c2-nyc2 asterisk-16.6.1]# 
 



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list