Skip to content

Commit 136f5f2

Browse files
committed
a better check against bang handler before registering phase handlers
1 parent c5b9931 commit 136f5f2

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/ngx_http_haskell_module.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ ngx_http_haskell_init(ngx_conf_t *cf)
339339
}
340340
}
341341

342-
if (!mcf->code_loaded && !mcf->has_bang_handler) {
342+
if (!mcf->code_loaded && !mcf->check_bang_handler) {
343343
return NGX_OK;
344344
}
345345

@@ -1593,7 +1593,9 @@ ngx_http_haskell_run(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
15931593
"bang handler accepts exactly one argument");
15941594
return NGX_CONF_ERROR;
15951595
}
1596-
mcf->has_bang_handler = 1;
1596+
if (!mcf->check_bang_handler && (strict_early || strict)) {
1597+
mcf->check_bang_handler = 1;
1598+
}
15971599
goto add_variable;
15981600
}
15991601

src/ngx_http_haskell_module.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ typedef struct {
181181
ngx_uint_t has_async_handlers:1;
182182
ngx_uint_t has_strict_vars:1;
183183
ngx_uint_t has_strict_early_vars:1;
184-
ngx_uint_t has_bang_handler:1;
184+
ngx_uint_t check_bang_handler:1;
185185
ngx_uint_t request_var_name_done:1;
186186
} ngx_http_haskell_main_conf_t;
187187

0 commit comments

Comments
 (0)