Copilot commented on code in PR #13435:
URL: https://github.com/apache/trafficserver/pull/13435#discussion_r3667162657
##########
tests/gold_tests/pluginTest/stats_over_http/stats_over_http.test.py:
##########
@@ -47,12 +48,28 @@ def __setupTS(self):
self.ts = Test.MakeATSProcess("ts")
self.ts.Disk.plugin_config.AddLine('stats_over_http.so _stats')
+ self.ts.Disk.logging_yaml.AddLines(
+ '''
+logging:
+ formats:
+ - name: unmapped_url
+ format: "%<cquuc>"
+ logs:
+ - filename: stats_over_http_url
+ format: unmapped_url
+'''.split("\n"))
Review Comment:
The triple-quoted YAML string is indented inside the Python block, so the
leading spaces become part of the YAML and can change its structure (e.g.,
`logging:` no longer being at the document root). Use a dedent (e.g.,
`textwrap.dedent(...)`) or construct the YAML as an unindented list of lines to
ensure valid top-level YAML.
##########
src/proxy/http/HttpTransact.cc:
##########
@@ -1022,9 +1022,10 @@ HttpTransact::HandleBlindTunnel(State *s)
void
HttpTransact::StartRemapRequest(State *s)
{
- // Preserve effective url before remap, regardless of actual need for remap
+ // Preserve the effective URL before remap, regardless of the actual need
for remap.
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);
Review Comment:
Previously, Host promotion into `unmapped_url` only happened when the URL
lacked a host (`!m_ptr_host`). If `set_url_target_from_host_field(...)`
overwrites an existing host (e.g., for absolute-form requests where the URL
already has a host), this changes behavior and could make `unmapped_url`
inaccurate. Consider guarding the call so it only fills host/port when missing
(matching the prior semantics), or use/introduce a helper that performs a
'promote only if absent' update.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]