You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jv...@apache.org on 2026/10/20 11:00:32 UTC

(trafficserver) branch master updated: Set VIA result for 206 and pass-through responses (#13852)

This is an automated email from the ASF dual-hosted git repository.

JosiahWI pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 93349b3c44 Set VIA result for 206 and pass-through responses (#13852)
93349b3c44 is described below

commit 93349b3c44de9c52b7a0453dbb56b90508cd4863
Author: Shivam Maurya <15...@users.noreply.github.com>
AuthorDate: Tue Oct 20 16:30:26 2026 +0530

    Set VIA result for 206 and pass-through responses (#13852)
    
    handle_no_cache_operation_on_forward_server_response() only populated
    VIA_SERVER_RESULT and VIA_PROXY_RESULT in the 200 OK and 304 Not Modified
    branches. Responses that fall into the PARTIAL_CONTENT (206) or default
    branches were forwarded to the client without recording that the origin
    had served them, so the Via debug window looked the same as for a
    locally synthesized error (e.g. a DNS-failure 500).
    
    The cached path (handle_cache_operation_on_forward_server_response) already
    sets both fields for its default branch; make the no-cache path consistent.
    
    Fixes: #13118
---
 src/proxy/http/HttpTransact.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/proxy/http/HttpTransact.cc b/src/proxy/http/HttpTransact.cc
index 2dc61ac65d..1a7f3b8986 100644
--- a/src/proxy/http/HttpTransact.cc
+++ b/src/proxy/http/HttpTransact.cc
@@ -5100,6 +5100,8 @@ HttpTransact::handle_no_cache_operation_on_forward_server_response(State *s)
   case HTTPStatus::PARTIAL_CONTENT:
     // If we get this back we should be just passing it through.
     ink_assert(s->cache_info.action == CacheAction_t::NO_ACTION);
+    SET_VIA_STRING(VIA_SERVER_RESULT, VIA_SERVER_SERVED);
+    SET_VIA_STRING(VIA_PROXY_RESULT, VIA_PROXY_SERVED);
     s->next_action = StateMachineAction_t::SERVER_READ;
     break;
   default:
@@ -5107,6 +5109,8 @@ HttpTransact::handle_no_cache_operation_on_forward_server_response(State *s)
     /* Default behavior is to pass-through response to the client */
 
     ink_assert(s->cache_info.action == CacheAction_t::NO_ACTION);
+    SET_VIA_STRING(VIA_SERVER_RESULT, VIA_SERVER_SERVED);
+    SET_VIA_STRING(VIA_PROXY_RESULT, VIA_PROXY_SERVED);
     s->next_action = StateMachineAction_t::SERVER_READ;
     break;
   }