From 0ec7ee09185b901f2fe9288ae6914f8fd735abb9 Mon Sep 17 00:00:00 2001 From: Weixie Cui Date: Fri, 30 Oct 2026 18:30:40 +0800 Subject: [PATCH] fix(balancer): set upstream schema when toggling TLS Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/ngx_http_lua_balancer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ngx_http_lua_balancer.c b/src/ngx_http_lua_balancer.c index ff0b2a5dc6..2d1c845aa6 100644 --- a/src/ngx_http_lua_balancer.c +++ b/src/ngx_http_lua_balancer.c @@ -1342,11 +1342,11 @@ ngx_http_lua_ffi_balancer_set_upstream_tls(ngx_http_request_t *r, int on, if (on == 0) { u->ssl = 0; - u->schema.len = sizeof("http://") - 1; + ngx_str_set(&u->schema, "http://"); } else { u->ssl = 1; - u->schema.len = sizeof("https://") - 1; + ngx_str_set(&u->schema, "https://"); } return NGX_OK;