diff options
author | Ashley Sanders <asanders@digium.com> | 2015-01-30 16:52:12 +0000 |
---|---|---|
committer | Ashley Sanders <asanders@digium.com> | 2015-01-30 16:52:12 +0000 |
commit | 112d23c73e0a81f5870ba9f58aa588b89ae31c44 (patch) | |
tree | 7c4896840f1c084aebe51c9e9c6206c1c50f62d2 /include/asterisk/http.h | |
parent | 43dd42d8aeee1eff844f605544901016047348e2 (diff) |
HTTP: For httpd server, need option to define server name for security purposes
Added a new config property [servername] to the http.conf file; updated the http server to use the new property when sending responses, for showing http status through the CLI and when reporting status through the 'httpstatus' webpage.
ASTERISK-24316 #close
Reported By: Andrew Nagy
Review: https://reviewboard.asterisk.org/r/4374/
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@431471 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/http.h')
-rw-r--r-- | include/asterisk/http.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/asterisk/http.h b/include/asterisk/http.h index ad91823b5..bb8973dce 100644 --- a/include/asterisk/http.h +++ b/include/asterisk/http.h @@ -200,6 +200,28 @@ void ast_http_send(struct ast_tcptls_session_instance *ser, enum ast_http_method int status_code, const char *status_title, struct ast_str *http_header, struct ast_str *out, int fd, unsigned int static_content); +/*! + * \brief Creates and sends a formatted http response message. + * \param ser TCP/TLS session object + * \param status_code HTTP response code (200/401/403/404/500) + * \param status_title English equivalent to the status_code parameter + * \param http_header_data The formatted text to use in the http header + * \param text Additional informational text to use in the + * response + * + * \note Function constructs response headers from the status_code, status_title and + * http_header_data parameters. + * + * The response body is created as HTML content, from the status_code, + * status_title, and the text parameters. + * + * The http_header_data parameter will be freed as a result of calling function. + * + * \since 13.2.0 + */ +void ast_http_create_response(struct ast_tcptls_session_instance *ser, int status_code, + const char *status_title, struct ast_str *http_header_data, const char *text); + /*! \brief Send http "401 Unauthorized" response and close socket */ void ast_http_auth(struct ast_tcptls_session_instance *ser, const char *realm, const unsigned long nonce, const unsigned long opaque, int stale, const char *text); |