mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-08 22:27:07 +00:00
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
This commit is contained in:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user