[
https://issues.apache.org/jira/browse/TS-4797?focusedWorklogId=27889&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-27889
]
ASF GitHub Bot logged work on TS-4797:
--------------------------------------
Author: ASF GitHub Bot
Created on: 02/Sep/16 03:15
Start Date: 02/Sep/16 03:15
Worklog Time Spent: 10m
Work Description: Github user masaori335 commented on a diff in the pull
request:
https://github.com/apache/trafficserver/pull/951#discussion_r77287760
--- Diff: plugins/header_rewrite/parser.cc ---
@@ -50,6 +52,12 @@ Parser::Parser(const std::string &line) : _cond(false),
_empty(false)
_tokens.push_back(std::string(1, line[i]));
}
continue; /* always eat whitespace */
+ } else if (line[i] == '\\') {
+ // erase a backslash in quoted-string
+ if (inquote && extracting_token) {
--- End diff --
My commit message might be not suitable. What I want to fix is we can't use
**double quote** inside of quoted string.
We can make this more general, but it makes header_rewrite rules and parser
code more complicated.
Do you have any specific use cases to escape something outside of quoted
string?
Issue Time Tracking
-------------------
Worklog Id: (was: 27889)
Time Spent: 50m (was: 40m)
> Backslash-escape is not allowed in rewriting rules
> --------------------------------------------------
>
> Key: TS-4797
> URL: https://issues.apache.org/jira/browse/TS-4797
> Project: Traffic Server
> Issue Type: Bug
> Components: Plugins
> Reporter: Masaori Koshiba
> Fix For: 7.0.0
>
> Time Spent: 50m
> Remaining Estimate: 0h
>
> I noticed that backslash-escape in quoted-string is not allowed in
> header-rewrite plugin rules. IIRC, this is allowed in 5.3.x.
> e.g.
> {noformat}
> cond %{SEND_RESPONSE_HDR_HOOK}
> add-header Public-Key-Pins
> "pin-sha256=\"UgXZQmS15cJoBeWTvbmCE+PGw5/oHV00e+MMyuXr0YQ=\";
> pin-sha256=\"eYKlKmvqHnR4CsglcYuNzvro7rrmFINrje5nSAxnEsc=\"; max-age=600;
> includeSubDomains" [L]
> {noformat}
> I got below error
> {noformat}
> 20160830.16h19m34s [header_rewrite] malformed line "add-header
> Public-Key-Pins "pin-sha256=\"UgXZQmS15cJoBeWTvbmCE+PGw5/oHV00e+MMyuXr0YQ=\";
> pin-sha256=\"eYKlKmvqHnR4CsglcYuNzvro7rrmFINrje5nSAxnEsc=\"; max-age=600;
> includeSubDomains" [L]" ignoring...
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)