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

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

commit 1e408bd6282d1aa6a99a562b3cdf00fde5cfabbf
Author: Randall Meyer <[email protected]>
AuthorDate: Wed Apr 21 09:00:40 2021 -0700

    header_rewrite: Allow for relative path to geo database files (#7727)
    
    (cherry picked from commit 3159b63e9ef6afd8af47b75e5577359f9fe6b895)
---
 plugins/header_rewrite/header_rewrite.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/plugins/header_rewrite/header_rewrite.cc 
b/plugins/header_rewrite/header_rewrite.cc
index 55d8f0f..78e9f42 100644
--- a/plugins/header_rewrite/header_rewrite.cc
+++ b/plugins/header_rewrite/header_rewrite.cc
@@ -426,6 +426,10 @@ TSRemapNewInstance(int argc, char *argv[], void **ih, char 
* /* errbuf ATS_UNUSE
     }
   }
 
+  if (geoDBPath.find("/") != 0) {
+    geoDBPath = std::string(TSConfigDirGet()) + '/' + geoDBPath;
+  }
+
   std::call_once(initGeoLibs, [&geoDBPath]() { initGeoLib(geoDBPath); });
 
   RulesConfig *conf = new RulesConfig;

Reply via email to