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

eze pushed a commit to branch 8.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/8.1.x by this push:
     new 6052dba804 Normalize Accept-Encoding header value before cache lookup 
(#11598)
6052dba804 is described below

commit 6052dba804c399aa1b46c454329a1100041b9c8c
Author: Masakazu Kitajo <[email protected]>
AuthorDate: Tue Jul 23 10:28:51 2024 -0600

    Normalize Accept-Encoding header value before cache lookup (#11598)
    
    * Normalize Accept-Encoding header value before cache lookup
    
    Co-authored-by: Min Chen <[email protected]>
    
    * Remove autest test cases
    
    ---------
    
    Co-authored-by: Min Chen <[email protected]>
---
 proxy/http/HttpSM.cc      | 6 ++++--
 proxy/http/HttpTransact.h | 2 ++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 1080c66c3f..84c4fec2a7 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -4540,8 +4540,10 @@ HttpSM::do_cache_lookup_and_read()
   HttpCacheKey key;
   Cache::generate_key(&key, c_url, t_state.txn_conf->cache_generation_number);
 
+  t_state.hdr_info.cache_request.copy(&t_state.hdr_info.client_request);
+  HttpTransactHeaders::normalize_accept_encoding(t_state.txn_conf, 
&t_state.hdr_info.cache_request);
   Action *cache_action_handle =
-    cache_sm.open_read(&key, c_url, &t_state.hdr_info.client_request, 
t_state.txn_conf,
+    cache_sm.open_read(&key, c_url, &t_state.hdr_info.cache_request, 
t_state.txn_conf,
                        (time_t)((t_state.cache_control.pin_in_cache_for < 0) ? 
0 : t_state.cache_control.pin_in_cache_for));
   //
   // pin_in_cache value is an open_write parameter.
@@ -4657,7 +4659,7 @@ HttpSM::do_cache_prepare_action(HttpCacheSM *c_sm, 
CacheHTTPInfo *object_read_in
   Cache::generate_key(&key, s_url, t_state.txn_conf->cache_generation_number);
 
   Action *cache_action_handle = c_sm->open_write(
-    &key, s_url, &t_state.hdr_info.client_request, object_read_info,
+    &key, s_url, &t_state.hdr_info.cache_request, object_read_info,
     (time_t)((t_state.cache_control.pin_in_cache_for < 0) ? 0 : 
t_state.cache_control.pin_in_cache_for), retry, allow_multiple);
 
   if (cache_action_handle != ACTION_RESULT_DONE) {
diff --git a/proxy/http/HttpTransact.h b/proxy/http/HttpTransact.h
index 52ddf676c5..fd81741a9b 100644
--- a/proxy/http/HttpTransact.h
+++ b/proxy/http/HttpTransact.h
@@ -653,6 +653,7 @@ public:
     HTTPHdr server_request;
     HTTPHdr server_response;
     HTTPHdr transform_response;
+    HTTPHdr cache_request;
     HTTPHdr cache_response;
     int64_t request_content_length  = HTTP_UNDEFINED_CL;
     int64_t response_content_length = HTTP_UNDEFINED_CL;
@@ -885,6 +886,7 @@ public:
       hdr_info.server_request.destroy();
       hdr_info.server_response.destroy();
       hdr_info.transform_response.destroy();
+      hdr_info.cache_request.destroy();
       hdr_info.cache_response.destroy();
       cache_info.lookup_url_storage.destroy();
       cache_info.parent_selection_url_storage.destroy();

Reply via email to