Skip to content

Restore host in unmapped URL logs - #13435

Open
bneradt wants to merge 1 commit into
apache:masterfrom
bneradt:fix-unmapped-url-host
Open

Restore host in unmapped URL logs#13435
bneradt wants to merge 1 commit into
apache:masterfrom
bneradt:fix-unmapped-url-host

Conversation

@bneradt

@bneradt bneradt commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Intercepted requests that skip remapping preserve an unmapped URL
before the Host header is promoted. The valid but incomplete snapshot
prevents logging from using its fallback and produces URLs such as
http:///_stats.

This promotes the request target into the unmapped URL when the
snapshot is created, regardless of whether remapping will run. It also
adds stats_over_http coverage for hostless cquuc output.

Fixes: #11378


Background

Before #10304, unmapped_url was created in
HttpSM::do_remap_request(), where the request Host value was also
promoted into the saved URL. Server intercepts such as
stats_over_http skip remapping, so their unmapped_url remained
invalid. The cquuc logger handled that state by falling back to the
current client URL, which included the host.

#10304 moved creation of unmapped_url to
HttpTransact::StartRemapRequest() so requests that skip remapping
would still have a valid snapshot. This fixed a crash while marking
parent hosts down and was cherry-picked to 9.2.x for 9.2.3. However,
Host promotion stayed in HttpSM::do_remap_request().

That left intercepted requests with a valid but incomplete snapshot.
Because it was valid, logging no longer used the fallback; because
remapping was skipped, the host was never promoted, producing values
such as http:///_stats. This change performs Host promotion when the
snapshot is created so both remapped and intercepted requests preserve
a complete pre-remap URL.

Intercepted requests that skip remapping preserve an unmapped URL
before the Host header is promoted. The valid but incomplete snapshot
prevents logging from using its fallback and produces URLs such as
http:///_stats.

This promotes the request target into the unmapped URL when the
snapshot is created, regardless of whether remapping will run. It also
adds stats_over_http coverage for hostless cquuc output.

Fixes: apache#11378
Copilot AI review requested due to automatic review settings July 27, 2026 18:14
@bneradt bneradt added this to the 11.0.0 milestone Jul 27, 2026
@bneradt bneradt self-assigned this Jul 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment on lines +51 to +60
self.ts.Disk.logging_yaml.AddLines(
'''
logging:
formats:
- name: unmapped_url
format: "%<cquuc>"
logs:
- filename: stats_over_http_url
format: unmapped_url
'''.split("\n"))
Comment on lines 1026 to +1028
s->unmapped_url.create(s->hdr_info.client_request.url_get()->m_heap);
s->unmapped_url.copy(s->hdr_info.client_request.url_get());
s->hdr_info.client_request.set_url_target_from_host_field(&s->unmapped_url);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Logs don't display URL properly for plugins

2 participants