Added build flags and Test for OWASP headers

This commit is contained in:
Russ Young
2021-04-20 11:55:28 -06:00
parent f3e23793a7
commit 065f51e6af
9 changed files with 136 additions and 8 deletions

View File

@@ -438,7 +438,7 @@ int get_auth_handler2(worker_st * ws, unsigned http_ver, const char *pmsg, unsig
goto cleanup;
}
#ifdef ADD_OWASP_HEADERS
#ifdef ENABLE_OWASP_HEADERS
ret = add_owasp_headers(ws);
if (ret < 0) {
ret = -1;
@@ -1097,7 +1097,7 @@ int post_common_handler(worker_st * ws, unsigned http_ver, const char *imsg)
if (ret < 0)
goto fail;
#ifdef ADD_OWASP_HEADERS
#ifdef ENABLE_OWASP_HEADERS
ret =
add_owasp_headers(ws);
if (ret < 0)

View File

@@ -58,7 +58,7 @@ static int send_headers(worker_st *ws, unsigned http_ver, const char *content_ty
cstp_printf(ws, "Content-Type: %s\r\n", content_type) < 0 ||
cstp_puts (ws, "X-Transcend-Version: 1\r\n") < 0 ||
cstp_printf(ws, "Content-Length: %u\r\n", content_length) < 0 ||
#ifdef ADD_OWASP_HEADERS
#ifdef ENABLE_OWASP_HEADERS
add_owasp_headers(ws) < 0 ||
#endif
cstp_puts (ws, "\r\n") < 0)

View File

@@ -863,7 +863,7 @@ void http_req_deinit(worker_st * ws)
ws->req.body = NULL;
}
#if defined(ADD_OWASP_HEADERS)
#ifdef ENABLE_OWASP_HEADERS
/* add_owasp_headers:
* @ws: an initialized worker structure
*

View File

@@ -273,7 +273,7 @@ int post_kkdcp_handler(worker_st *ws, unsigned http_ver)
goto fail;
}
#ifdef ADD_OWASP_HEADERS
#ifdef ENABLE_OWASP_HEADERS
ret = add_owasp_headers(ws);
if (ret < 0) {
goto fail;

View File

@@ -1931,7 +1931,7 @@ static int connect_handler(worker_st * ws)
ret = cstp_puts(ws, "HTTP/1.1 200 CONNECTED\r\n");
SEND_ERR(ret);
#ifdef ADD_OWASP_HEADERS
#ifdef ENABLE_OWASP_HEADERS
ret = add_owasp_headers(ws);
SEND_ERR(ret);
#endif

View File

@@ -422,7 +422,7 @@ int parse_proxy_proto_header(struct worker_st *ws, int fd);
void cookie_authenticate_or_exit(worker_st *ws);
#ifdef ADD_OWASP_HEADERS
#ifdef ENABLE_OWASP_HEADERS
int add_owasp_headers(worker_st * ws);
#endif