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

Friendly Automation (JIRA) noreply at issues.asterisk.org
Fri Nov 6 11:50:15 CST 2020


    [ https://issues.asterisk.org/jira/browse/ASTERISK-28825?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=252681#comment-252681 ] 

Friendly Automation commented on ASTERISK-28825:
------------------------------------------------

Change 15066 merged by Friendly Automation:
func_curl.c: Allow user to set what return codes constitute a failure.

[https://gerrit.asterisk.org/c/asterisk/+/15066|https://gerrit.asterisk.org/c/asterisk/+/15066]

> 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
>              Labels: patch
>         Attachments: 28825-1.patch, 28825-2.patch, 28825-3.patch
>
>
> 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