Copilot commented on code in PR #13370:
URL: https://github.com/apache/trafficserver/pull/13370#discussion_r3545030079


##########
plugins/prefetch/plugin.cc:
##########
@@ -851,8 +851,8 @@ TSRemapDoRemap(void *instance, TSHttpTxn txnp, 
TSRemapRequestInfo *rri)
             PrefetchDebug("failed to get path to (pre)match");
           }
 
-          String queryKey = config.getQueryKeyName();
-          if (!queryKey.empty()) {
+          const String &queryKey = config.getQueryKeyName();
+          if (!handleFetch && !queryKey.empty() && 
getPristineUrlQuery(txnp).find(queryKey) != String::npos) {
             PrefetchDebug("handling for query-key: %s", queryKey.c_str());
             handleFetch = true;
           }

Review Comment:
   The query-key gate uses `getPristineUrlQuery(txnp).find(queryKey)` which 
will match substrings in other parameter names or values (e.g. 
`other=foo<queryKey>bar`), re-admitting requests that don’t actually carry the 
configured key. This can also admit requests where the later query-param loop 
(which expects `param` to start with the key) schedules no prefetch at all.



-- 
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]

Reply via email to