File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -265,8 +265,18 @@ int perform_interception(modsec_rec *msr) {
265
265
#if !defined(WIN32 ) && !defined(VERSION_NGINX )
266
266
{
267
267
extern module core_module ;
268
- apr_socket_t * csd = ap_get_module_config (msr -> r -> connection -> conn_config ,
269
- & core_module );
268
+ apr_socket_t * csd ;
269
+
270
+ /* For mod_http2 used by HTTP/2 there is a virtual connection so must go through
271
+ * master to get the main connection or the drop request doesn't seem to do anything.
272
+ * For HTTP/1.1 master will not be defined so just go through normal connection.
273
+ * More details here: https://github.com/icing/mod_h2/issues/127
274
+ */
275
+ if (msr -> r -> connection -> master ) {
276
+ csd = ap_get_module_config (msr -> r -> connection -> master -> conn_config , & core_module );
277
+ } else {
278
+ csd = ap_get_module_config (msr -> r -> connection -> conn_config , & core_module );
279
+ }
270
280
271
281
if (csd ) {
272
282
if (apr_socket_close (csd ) == APR_SUCCESS ) {
You can’t perform that action at this time.
0 commit comments