mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Detect and use new API calls to get the server version/banner when available.
This commit is contained in:
@@ -13,6 +13,8 @@
|
||||
|
||||
#include "http_core.h"
|
||||
#include "http_request.h"
|
||||
#include "httpd.h"
|
||||
#include "ap_release.h"
|
||||
|
||||
#include <apr_general.h>
|
||||
#include <apr_optional.h>
|
||||
@@ -30,6 +32,19 @@ APR_DECLARE_OPTIONAL_FN(void, modsec_register_variable,
|
||||
unsigned int is_cacheable, unsigned int availability));
|
||||
#endif
|
||||
|
||||
/* ap_get_server_version() is gone in 2.3.0.
|
||||
* It was replaced by two calls in 2.2.4 and higher:
|
||||
* ap_get_server_banner()
|
||||
* ap_get_server_description()
|
||||
*/
|
||||
#if (AP_SERVER_MAJORVERSION_NUMBER > 2) \
|
||||
|| ((AP_SERVER_MAJORVERSION_NUMBER == 2)&& (AP_SERVER_MINORVERSION_NUMBER > 2)) \
|
||||
|| ((AP_SERVER_MAJORVERSION_NUMBER == 2) && (AP_SERVER_MINORVERSION_NUMBER == 2) && (AP_SERVER_PATCHLEVEL_NUMBER >= 4))
|
||||
#define apache_get_server_version() ap_get_server_banner()
|
||||
#else
|
||||
#define apache_get_server_version() ap_get_server_version()
|
||||
#endif
|
||||
|
||||
|
||||
/* Configuration functions. */
|
||||
|
||||
|
Reference in New Issue
Block a user