Uploaded image for project: 'Traffic Server'
  1. Traffic Server
  2. TS-4809

[header_rewrite] check to make sure "hook" conditions are first in the rule set

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.0.0
    • Component/s: Plugins
    • Labels:
      None

      Description

      The following configuration

      $ cat etc/trafficserver/remap.config
      map http://example.com http://127.0.0.1:8888 \
          @plugin=header_rewrite.so @pparam=hdrs.config
      
      $ cat etc/trafficserver/hdrs.config
      cond %{TRUE}
      cond %{REMAP_PSEUDO_HOOK}
         set-header Some-Header "some value"
      

      Triggers the following error which does not show what and where the problem is:

      20160901.23h17m13s [header_rewrite] Unknown condition: REMAP_PSEUDO_HOOK
      

      I would like to add a check which will prevent the above error and print another error clarifying where and what the problem is, for instance:

      20160901.23h17m13s [header_rewrite] cond %{REMAP_PSEUDO_HOOK} should come first in the rule set at hdrs.config:2
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                gancho Gancho Tenev
                Reporter:
                gancho Gancho Tenev
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1.5h
                  1.5h