From 8d1df1843770809174772458b5dcce3e001d5d7a Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sun, 8 Nov 2026 18:40:59 +0000 Subject: [PATCH 1/3] * test/modules/core/test_013_expr_proto_version.py: New test suite. Co-Authored-By: Claude Opus 5.5 --- .../core/test_013_expr_proto_version.py | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 test/modules/core/test_013_expr_proto_version.py diff --git a/test/modules/core/test_013_expr_proto_version.py b/test/modules/core/test_013_expr_proto_version.py new file mode 100644 index 00000000000..9d4148a3d8d --- /dev/null +++ b/test/modules/core/test_013_expr_proto_version.py @@ -0,0 +1,40 @@ +import pytest + +from pyhttpd.backport import not_backported +from pyhttpd.conf import HttpdConf + +pytestmark = not_backported("r1410755", + "SERVER_PROTOCOL_VERSION ap_expr variables") + + +# The variables do not parse on a server without them, so the restart +# status is checked by each test rather than here. +@pytest.fixture(scope='module') +def restart_rc(env): + conf = HttpdConf(env, extras={ + 'base': """ + ErrorDocument 404 "v=%{SERVER_PROTOCOL_VERSION} major=%{SERVER_PROTOCOL_VERSION_MAJOR} minor=%{SERVER_PROTOCOL_VERSION_MINOR}" + """ + }) + conf.add_vhost_test1() + conf.install() + return env.apache_restart() + + +class TestExprProtoVersion: + + def get(self, env, restart_rc, options): + assert restart_rc == 0 + r = env.curl_get(env.mkurl("http", "test1", "/no-such-file"), + options=options) + assert r.response, f"no response: {r.stderr}" + assert r.response["status"] == 404 + return r.response["body"].decode().strip() + + def test_core_013_01_http11(self, env, restart_rc): + assert self.get(env, restart_rc, ['--http1.1']) == \ + "v=1001 major=1 minor=1" + + def test_core_013_02_http10(self, env, restart_rc): + assert self.get(env, restart_rc, ['--http1.0']) == \ + "v=1000 major=1 minor=0" From 042c4b5e8e974f390ce397186b0571ecc3b3c1aa Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 13 Nov 2026 17:02:50 +0000 Subject: [PATCH 2/3] * test/modules/core/test_013_expr_proto_version.py: Mark as backported in 2.4.72. Co-Authored-By: Claude Opus 5.5 Co-Authored-By: Claude Fable 5.2 --- test/modules/core/test_013_expr_proto_version.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/modules/core/test_013_expr_proto_version.py b/test/modules/core/test_013_expr_proto_version.py index 9d4148a3d8d..39fa43a05e0 100644 --- a/test/modules/core/test_013_expr_proto_version.py +++ b/test/modules/core/test_013_expr_proto_version.py @@ -4,7 +4,8 @@ from pyhttpd.conf import HttpdConf pytestmark = not_backported("r1410755", - "SERVER_PROTOCOL_VERSION ap_expr variables") + "SERVER_PROTOCOL_VERSION ap_expr variables", + backported_in="2.4.72") # The variables do not parse on a server without them, so the restart From 7b52ba8c6151440ced226b056babe68da734cfca Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sun, 8 Nov 2026 19:30:33 +0000 Subject: [PATCH 3/3] * changes-entries/pr70295.txt: Prefix with core:. Co-Authored-By: Claude Opus 5.5 --- changes-entries/pr70295.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changes-entries/pr70295.txt b/changes-entries/pr70295.txt index 7d3c73758b3..b9a24f78e5e 100644 --- a/changes-entries/pr70295.txt +++ b/changes-entries/pr70295.txt @@ -1,2 +1,2 @@ - *) mod_remote_ip: Fix REMOTE_PORT in expressions and environment variables. + *) core: Fix REMOTE_PORT in expressions and environment variables. PR 70295. [Steve Bennett ]