You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by rr...@apache.org on 2021/04/21 16:00:55 UTC

[trafficserver] branch master updated: header_rewrite: Allow for relative path to geo database files (#7727)

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

rrm 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 3159b63  header_rewrite: Allow for relative path to geo database files (#7727)
3159b63 is described below

commit 3159b63e9ef6afd8af47b75e5577359f9fe6b895
Author: Randall Meyer <rr...@apache.org>
AuthorDate: Wed Apr 21 09:00:40 2021 -0700

    header_rewrite: Allow for relative path to geo database files (#7727)
---
 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;