You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by jacksontj <gi...@git.apache.org> on 2015/08/28 23:29:15 UTC

[GitHub] trafficserver pull request: TS-3874: Header-rewrite: support multi...

GitHub user jacksontj opened a pull request:

    https://github.com/apache/trafficserver/pull/284

    TS-3874: Header-rewrite: support multiple header values in conditionals

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jacksontj/trafficserver master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/trafficserver/pull/284.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #284
    
----
commit 29d4275c6b8d6f07a9d284ffbf4e2bab3a16e06a
Author: Thomas Jackson <ja...@apache.org>
Date:   2015-08-28T21:27:25Z

    TS-3874: Header-rewrite: support multiple header values in conditionals

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: TS-3874: Header-rewrite: support multi...

Posted by jpeach <gi...@git.apache.org>.
Github user jpeach commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/284#discussion_r38252894
  
    --- Diff: doc/reference/plugins/header_rewrite.en.rst ---
    @@ -208,3 +208,44 @@ Examples
       rm-header Set-Cookie
       counter plugin.header_rewrite.x-y-foobar-dc1
       cond %{HEADER:X-Y-Foobar} "Some string" [AND,NC]
    +
    +
    +Notes about header conditionals
    +-------------------------------
    +In HTTP multple headers can be consolidated into a single comma separated string.
    +To avoid complex markup within header-rewrite all conditionals against headers
    --- End diff --
    
    This sentence doesn't scan that well ... is there a word missing?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: TS-3874: Header-rewrite: support multi...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/trafficserver/pull/284


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: TS-3874: Header-rewrite: support multi...

Posted by jpeach <gi...@git.apache.org>.
Github user jpeach commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/284#discussion_r38252920
  
    --- Diff: plugins/header_rewrite/conditions.cc ---
    @@ -237,13 +236,22 @@ ConditionHeader::append_value(std::string &s, const Resources &res)
       }
     
       if (bufp && hdr_loc) {
    +    TSMLoc field_loc, next_field_loc;
    +
         field_loc = TSMimeHdrFieldFind(bufp, hdr_loc, _qualifier.c_str(), _qualifier.size());
         TSDebug(PLUGIN_NAME, "Getting Header: %s, field_loc: %p", _qualifier.c_str(), field_loc);
    -    if (field_loc != NULL) {
    +
    +    while (field_loc) {
           value = TSMimeHdrFieldValueStringGet(bufp, hdr_loc, field_loc, -1, &len);
    +      next_field_loc = TSMimeHdrFieldNextDup(res.bufp, res.hdr_loc, field_loc);
           TSDebug(PLUGIN_NAME, "Appending HEADER(%s) to evaluation value -> %.*s", _qualifier.c_str(), len, value);
           s.append(value, len);
    +      // multiple headers with the same name must be symantically the same as one value which is comma seperated (http://tools.ietf.org/html/rfc2616#section-4.2)
    --- End diff --
    
    *semantically*


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: TS-3874: Header-rewrite: support multi...

Posted by sudheerv <gi...@git.apache.org>.
Github user sudheerv commented on the pull request:

    https://github.com/apache/trafficserver/pull/284#issuecomment-135915883
  
    lgtm


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] trafficserver pull request: TS-3874: Header-rewrite: support multi...

Posted by jpeach <gi...@git.apache.org>.
Github user jpeach commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/284#discussion_r38252875
  
    --- Diff: doc/reference/plugins/header_rewrite.en.rst ---
    @@ -208,3 +208,44 @@ Examples
       rm-header Set-Cookie
       counter plugin.header_rewrite.x-y-foobar-dc1
       cond %{HEADER:X-Y-Foobar} "Some string" [AND,NC]
    +
    +
    +Notes about header conditionals
    --- End diff --
    
    Use the ```.. note::``` markup here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---