shorinji opened a new pull request #383:
URL: https://github.com/apache/tomcat/pull/383
Currently addVaryFieldName() add a value twice when there already is named
value (not asterisk).
The existing tests did not catch this, since they assert using a HashMap
thus containing no duplicates.
I have updated one of the test case, inlining parts of the
doTestAddVaryFieldName() that can be reused.
Adding `System.out.println("adding " + name + " with " +
adapter.getHeaders(VARY_HEADER) + " already present = " + varyHeader);` at the
end of addVaryFieldName() we can track what happens when running the tests:
`test-nio:
[junit] Running org.apache.tomcat.util.http.TestResponseUtil
[junit] adding too with [foo, bar] already present = too,bar,too,foo
[junit] adding too with [{{{, bar] already present = too,bar,too
[junit] adding foo with [foo, bar] already present = foo,bar,foo
[junit] adding bar with [{{{, bar] already present = bar,bar
[junit] adding too with [foo, bar] already present = too,bar,too,foo
[junit] adding too with [foo, bar] already present = too,bar,too,foo
[junit] adding foo with [foo, bar] already present = foo,bar,foo
...`
After my patch this looks like:
`test-nio:
[junit] Running org.apache.tomcat.util.http.TestResponseUtil
[junit] adding too with [foo, bar] already present = bar,too,foo
[junit] adding too with [{{{, bar] already present = bar,too
[junit] adding foo with [foo, bar] already present = bar,foo
[junit] adding bar with [{{{, bar] already present = bar
[junit] adding too with [foo, bar] already present = bar,too,foo
[junit] adding too with [foo, bar] already present = bar,too,foo
[junit] adding foo with [foo, bar] already present = bar,foo
`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]