From f3e6c579de0424da860a519f689fafe89ce25563 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sun, 8 Nov 2026 17:45:50 +0000 Subject: [PATCH 1/5] * test/modules/metadata/test_004_remoteip.py (TestRemoteIp.REMOTE_PORT_FIX): Mark as backported in 2.4.71. Co-Authored-By: Claude Opus 5.5 --- test/modules/metadata/test_004_remoteip.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/modules/metadata/test_004_remoteip.py b/test/modules/metadata/test_004_remoteip.py index 8afca7784c7..dfc8a3aab68 100644 --- a/test/modules/metadata/test_004_remoteip.py +++ b/test/modules/metadata/test_004_remoteip.py @@ -245,7 +245,8 @@ def test_metadata_004_06(self, env): # wherever a configuration asks for it: the REMOTE_PORT variable of # ap_expr (here via mod_headers) and the CGI/SSI REMOTE_PORT variable # (here via mod_include). Bug 70295. - REMOTE_PORT_FIX = not_backported("gh-896", "REMOTE_PORT from the useragent address") + REMOTE_PORT_FIX = not_backported("gh-896", "REMOTE_PORT from the useragent address", + backported_in="2.4.71") def remote_port_install(self, env): """A PROXY protocol vhost on http_port2 and an X-Forwarded-For one From b09676e858683a4d27834a7c6a3042d9ea53b294 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sun, 8 Nov 2026 18:40:59 +0000 Subject: [PATCH 2/5] * 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 e6c53c141aa060d40a70363be899ca73d8b4129c Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sun, 8 Nov 2026 19:30:33 +0000 Subject: [PATCH 3/5] * test/modules/core/test_013_expr_proto_version.py: Mark as backported in 2.4.71. Co-Authored-By: Claude Opus 5.5 --- 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..aa57e8f1261 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.71") # The variables do not parse on a server without them, so the restart From daa9e4aa668c26fbbbd15247859b72a01c61999c Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sun, 8 Nov 2026 19:30:33 +0000 Subject: [PATCH 4/5] * docs/manual/expr.xml: SERVER_PROTOCOL_VERSION, _MAJOR and _MINOR are available from 2.4.71. Co-Authored-By: Claude Opus 5.5 --- docs/manual/expr.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/manual/expr.xml b/docs/manual/expr.xml index 89e1a46f0b9..250f74046d2 100644 --- a/docs/manual/expr.xml +++ b/docs/manual/expr.xml @@ -719,7 +719,7 @@ DIGIT ::= <any US-ASCII digit "0".."9"> SERVER_PROTOCOL_VERSION_MAJOR and SERVER_PROTOCOL_VERSION_MINOR variables - are available for versions 2.5.0 and later.

+ are available for versions 2.4.71 and later.

From 335ec0365d7892ebcf35f19c22918a25975167a2 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Sun, 8 Nov 2026 19:30:33 +0000 Subject: [PATCH 5/5] * 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 ]