Repository navigation
core: Add a "b" flag to ErrorLogFormat's %a/%A for RFC 5952 bracketed IPv6 addresses (#1016) - #1027
Merged
arturobernalg merged 1 commit intoNov 14, 2026
Conversation
…apache#1016) IPv6 addresses. %a and %A log an IPv6 address and port as "address:port", e.g. "::1:34567" -- ambiguous, since both the address and the address/port separator use ':'. This makes it hard for downstream log parsers (syslog anonymizers, SIEMs, etc.) to tell where the address ends and the port begins. Add an opt-in "b" flag, "%{b}a" and "%{b}A", that writes the same address and port in the RFC 5952, section 6 bracket notation, "[address]:port", matching the convention already used by other HTTP implementations for the same ambiguity (e.g. Netty's NetUtil.toSocketAddressString(), OkHttp's HttpUrl.Builder.toString()). IPv4 addresses are unaffected either way. The existing "%a"/"%A"/"%{c}a" output is unchanged, so no existing log consumer is affected unless it opts in. PR 65696 (cherry picked from commit 14d0c60)
covener
approved these changes
Nov 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(cherry picked from commit 14d0c60)
Backport of #1016.
BZ: https://bz.apache.org/bugzilla/show_bug.cgi?id=65696
[x] This PR does not report or address a security vulnerability (see SECURITY.md and https://www.apache.org/security/#reporting-a-vulnerability).
[x] Code follows the httpd style guide.
[x] New log messages (level debug or higher) use an empty APLOGNO() tag (not applicable -- no new log messages).
[x] If the change is user-visible, a changes-entries/*.txt file is included (carried over unchanged from the trunk commit).
[x] Test cases based on pyhttpd are included where appropriate (test/modules/core/test_016_errorlogformat_ipv6_bracket.py, carried over unchanged. Rebuilt this exact 2.4.x worktree and ran it against a real IPv6 (::1) listener: both the default-format-unchanged case and the new %{b}a/%{b}A bracket case pass).