You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by so...@apache.org on 2017/12/21 21:56:51 UTC

[trafficserver] branch master updated: Fixed uri_signing plugin to use pristine request header.

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

sorber 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 fd2ce43  Fixed uri_signing plugin to use pristine request header.
fd2ce43 is described below

commit fd2ce43942c792c0277257f54db42e91eae8867a
Author: Chris Lemmons <ch...@comcast.com>
AuthorDate: Wed Dec 20 22:09:43 2017 +0000

    Fixed uri_signing plugin to use pristine request header.
    
    Previously, the remapped header was being used, which violated the
    draft RFC with which this plugin attempts to comply. Additionally,
    it made the remap ordering fragile and confusing.
---
 plugins/experimental/uri_signing/uri_signing.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/plugins/experimental/uri_signing/uri_signing.c b/plugins/experimental/uri_signing/uri_signing.c
index a33f03b..c2062a1 100644
--- a/plugins/experimental/uri_signing/uri_signing.c
+++ b/plugins/experimental/uri_signing/uri_signing.c
@@ -156,7 +156,19 @@ TSRemapDoRemap(void *ih, TSHttpTxn txnp, TSRemapRequestInfo *rri)
 
   const char *package = "URISigningPackage";
   int url_ct          = 0;
-  const char *url     = TSUrlStringGet(rri->requestBufp, rri->requestUrl, &url_ct);
+  const char *url     = NULL;
+
+  TSMBuffer mbuf;
+  TSMLoc ul;
+  TSReturnCode rc = TSHttpTxnPristineUrlGet(txnp, &mbuf, &ul);
+  if (rc != TS_SUCCESS) {
+    PluginError("Failed call to TSHttpTxnPristineUrlGet()");
+    goto fail;
+  }
+  url = TSUrlStringGet(mbuf, ul, &url_ct);
+
+  PluginDebug("Processing request for %.*s.", url_ct, url);
+
   if (cpi < max_cpi) {
     checkpoints[cpi++] = mark_timer(&t);
   }

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].