This is an automated email from the ASF dual-hosted git repository.
dmeden 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 727c700ba0 slheaders: Remap plugin fix. (#10990)
727c700ba0 is described below
commit 727c700ba0e6be6a73c0d0cb3f752c21ec65615e
Author: Damian Meden <[email protected]>
AuthorDate: Wed Jan 24 10:55:49 2024 +0100
slheaders: Remap plugin fix. (#10990)
argc,argv wasn't properly set to let the remap getopt handle them
correctly. This fix set the right value and pointer for the getopt
to work with.
---
plugins/experimental/sslheaders/sslheaders.cc | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/plugins/experimental/sslheaders/sslheaders.cc
b/plugins/experimental/sslheaders/sslheaders.cc
index 0b2c07c213..1a203fd9c1 100644
--- a/plugins/experimental/sslheaders/sslheaders.cc
+++ b/plugins/experimental/sslheaders/sslheaders.cc
@@ -303,6 +303,12 @@ TSRemapNewInstance(int argc, char *argv[], void
**instance, char * /* err */, in
{
SslHdrInstance *hdr;
+ // The first two arguments are the "from" and "to" URL string. We need to
+ // skip them, but we also require that there be an option to masquerade as
+ // argv[0], so we increment the argument indexes by 1 rather than by 2.
+ --argc;
+ ++argv;
+
hdr = SslHdrParseOptions(argc, (const char **)argv);
if (hdr) {
*instance = hdr;