[jira] [Updated] (TS-3956) header_rewrite applies strange logic with = operator and whitespace
[ https://issues.apache.org/jira/browse/TS-3956?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Leif Hedstrom updated TS-3956: -- Summary: header_rewrite applies strange logic with = operator and whitespace (was: Header_rewrite applies strange logic with = operator and whitespace) > header_rewrite applies strange logic with = operator and whitespace > --- > > Key: TS-3956 > URL: https://issues.apache.org/jira/browse/TS-3956 > Project: Traffic Server > Issue Type: Bug > Components: Plugins >Reporter: Brian Geffon >Assignee: Brian Geffon > Fix For: 6.1.0 > > > It appears that whitespace causes weird behavior with header_rewrite, for > example: > If you remove the white space before the = and the quotes it appears to > behave correctly. This whitespace issue is likely to cause strange bugs and > needs to be fixed. > {code} > cond %{READ_REQUEST_HDR_HOOK} > cond %{CLIENT-HEADER:Host} /^localhost$/ [AND] > cond %{CLIENT-HEADER:non_existent_header} = "shouldnt_exist_anyway" [AND] > add-header X-HeaderRewriteApplied true > {code} > With the following request: > {code} > curl -v localhost/ > {code} > Header_rewrite will incorrectly apply the rule: > {code} > [Oct 4 20:56:49.245] Server {0x761b5700} DIAG: (header_rewrite) Building > resources, hook=TS_HTTP_READ_REQUEST_HDR_HOOK > [Oct 4 20:56:49.245] Server {0x761b5700} DIAG: (header_rewrite) Adding > TXN client request header buffers > [Oct 4 20:56:49.245] Server {0x761b5700} DIAG: (header_rewrite) Getting > Header: Host, field_loc: 0x7fffd02070d0 > [Oct 4 20:56:49.245] Server {0x761b5700} DIAG: (header_rewrite) > Appending HEADER(Host) to evaluation value -> localhost > [Oct 4 20:56:49.245] Server {0x761b5700} DIAG: (header_rewrite) Test > regular expression ^localhost$ : localhost > [Oct 4 20:56:49.245] Server {0x761b5700} DIAG: (header_rewrite) > Successfully found regular expression match > [Oct 4 20:56:49.245] Server {0x761b5700} DIAG: (header_rewrite) > Evaluating HEADER(): localhost - rval: 1 > [Oct 4 20:56:49.245] Server {0x761b5700} DIAG: (header_rewrite) Getting > Header: non_existent_header, field_loc: (nil) > [Oct 4 20:56:49.245] Server {0x761b5700} DIAG: (header_rewrite) > Evaluating HEADER(): - rval: 1 > [Oct 4 20:56:49.245] Server {0x761b5700} DIAG: (header_rewrite) > OperatorAddHeader::exec() invoked on header X-HeaderRewriteApplied: true > [Oct 4 20:56:49.245] Server {0x761b5700} DIAG: (header_rewrite) > Adding header X-HeaderRewriteApplied > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (TS-3956) Header_rewrite applies strange logic with = operator and whitespace
[ https://issues.apache.org/jira/browse/TS-3956?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Brian Geffon updated TS-3956: - Fix Version/s: 6.1.0 > Header_rewrite applies strange logic with = operator and whitespace > --- > > Key: TS-3956 > URL: https://issues.apache.org/jira/browse/TS-3956 > Project: Traffic Server > Issue Type: Bug > Components: Plugins >Reporter: Brian Geffon >Assignee: Brian Geffon > Fix For: 6.1.0 > > > It appears that whitespace causes weird behavior with header_rewrite, for > example: > If you remove the white space before the = and the quotes it appears to > behave correctly. This whitespace issue is likely to cause strange bugs and > needs to be fixed. > {code} > cond %{READ_REQUEST_HDR_HOOK} > cond %{CLIENT-HEADER:Host} /^localhost$/ [AND] > cond %{CLIENT-HEADER:non_existent_header} = "shouldnt_exist_anyway" [AND] > add-header X-HeaderRewriteApplied true > {code} > With the following request: > {code} > curl -v localhost/ > {code} > Header_rewrite will incorrectly apply the rule: > {code} > [Oct 4 20:56:49.245] Server {0x761b5700} DIAG: (header_rewrite) Building > resources, hook=TS_HTTP_READ_REQUEST_HDR_HOOK > [Oct 4 20:56:49.245] Server {0x761b5700} DIAG: (header_rewrite) Adding > TXN client request header buffers > [Oct 4 20:56:49.245] Server {0x761b5700} DIAG: (header_rewrite) Getting > Header: Host, field_loc: 0x7fffd02070d0 > [Oct 4 20:56:49.245] Server {0x761b5700} DIAG: (header_rewrite) > Appending HEADER(Host) to evaluation value -> localhost > [Oct 4 20:56:49.245] Server {0x761b5700} DIAG: (header_rewrite) Test > regular expression ^localhost$ : localhost > [Oct 4 20:56:49.245] Server {0x761b5700} DIAG: (header_rewrite) > Successfully found regular expression match > [Oct 4 20:56:49.245] Server {0x761b5700} DIAG: (header_rewrite) > Evaluating HEADER(): localhost - rval: 1 > [Oct 4 20:56:49.245] Server {0x761b5700} DIAG: (header_rewrite) Getting > Header: non_existent_header, field_loc: (nil) > [Oct 4 20:56:49.245] Server {0x761b5700} DIAG: (header_rewrite) > Evaluating HEADER(): - rval: 1 > [Oct 4 20:56:49.245] Server {0x761b5700} DIAG: (header_rewrite) > OperatorAddHeader::exec() invoked on header X-HeaderRewriteApplied: true > [Oct 4 20:56:49.245] Server {0x761b5700} DIAG: (header_rewrite) > Adding header X-HeaderRewriteApplied > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)