mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 16:57:00 +08:00
Added build flags and Test for OWASP headers
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user