summaryrefslogtreecommitdiff
path: root/include/asterisk/http.h
diff options
context:
space:
mode:
authorAshley Sanders <asanders@digium.com>2015-01-30 17:21:50 +0000
committerAshley Sanders <asanders@digium.com>2015-01-30 17:21:50 +0000
commit6a76740b83c1ced26e9464a7abb5b30de4a60e6f (patch)
treeae6e42d3ff91c1669a262986d16523c9d5a3b6ab /include/asterisk/http.h
parentbd0bdf1e41c52afb6dbf262d60a8ed02d2110fcd (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. In this version, [servername] is uncommented by default. ASTERISK-24316 #close Reported By: Andrew Nagy Review: https://reviewboard.asterisk.org/r/4374/ ........ Merged revisions 431471 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431484 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/http.h')
-rw-r--r--include/asterisk/http.h22
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);