Skip to content

Commit 900031a

Browse files
committed
Fix worker panic when http is not configured.
1 parent 064714b commit 900031a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ extern "C" fn ngx_http_acme_init_worker(cycle: *mut ngx_cycle_t) -> ngx_int_t {
127127
// SAFETY: cycle passed to the module callbacks is never NULL
128128
let cycle = unsafe { &mut *cycle };
129129

130-
let amcf = HttpAcmeModule::main_conf(cycle).expect("acme main conf");
130+
let Some(amcf) = HttpAcmeModule::main_conf(cycle) else {
131+
return Status::NGX_OK.into();
132+
};
131133

132134
if !amcf.is_configured() {
133135
ngx_log_debug!(cycle.log, "acme: not configured");

0 commit comments

Comments
 (0)