mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-29 12:41:03 +00:00
Add MG_HIDE_SERVER_INFO
Closes https://github.com/cesanta/mos-libs/pull/2 CL: Add MG_HIDE_SERVER_INFO PUBLISHED_FROM=ed8a5b65f1c8238df414cd1c1f8bb1f579082f55
This commit is contained in:
1 parent
244ff92e78
commit
1299d6118f
2 files changed
+10
-4
No files matched your search
+5
-2
@@ -6872,8 +6872,11 @@ const char *mg_status_message(int status_code) {
|
||||
|
||||
void mg_send_response_line_s(struct mg_connection *nc, int status_code,
|
||||
const struct mg_str extra_headers) {
|
||||
mg_printf(nc, "HTTP/1.1 %d %s\r\nServer: %s\r\n", status_code,
|
||||
mg_status_message(status_code), mg_version_header);
|
||||
mg_printf(nc, "HTTP/1.1 %d %s\r\n", status_code,
|
||||
mg_status_message(status_code));
|
||||
#ifndef MG_HIDE_SERVER_INFO
|
||||
mg_printf(nc, "Server: %s\r\n", mg_version_header);
|
||||
#endif
|
||||
if (extra_headers.len > 0) {
|
||||
mg_printf(nc, "%.*s\r\n", (int) extra_headers.len, extra_headers.p);
|
||||
}
|
||||
|
||||
+5
-2
@@ -1311,8 +1311,11 @@ const char *mg_status_message(int status_code) {
|
||||
|
||||
void mg_send_response_line_s(struct mg_connection *nc, int status_code,
|
||||
const struct mg_str extra_headers) {
|
||||
mg_printf(nc, "HTTP/1.1 %d %s\r\nServer: %s\r\n", status_code,
|
||||
mg_status_message(status_code), mg_version_header);
|
||||
mg_printf(nc, "HTTP/1.1 %d %s\r\n", status_code,
|
||||
mg_status_message(status_code));
|
||||
#ifndef MG_HIDE_SERVER_INFO
|
||||
mg_printf(nc, "Server: %s\r\n", mg_version_header);
|
||||
#endif
|
||||
if (extra_headers.len > 0) {
|
||||
mg_printf(nc, "%.*s\r\n", (int) extra_headers.len, extra_headers.p);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user