Skip to content
This repository has been archived by the owner on Apr 8, 2019. It is now read-only.

GTNPORTAL-3560 - Changed the way the cache-control is sanitized. #917

Conversation

jpkrohling
Copy link
Contributor

No description provided.

@jpkrohling
Copy link
Contributor Author

@ppalaga or @lucasponce , could you review it? I was a bit concerned at first with the possible performance impact of replaceAll, but as the outcome will always be the same for a long time, it should be optimized by the VM.

@lucasponce
Copy link
Contributor

Hi Juca,

Compiler should optimize that. But for example, looking in other project
(Undertow) with performance constraints, they use something like a chain:

return msg.replace("<", "<").replace(">", ">").replace("&", "&");

Just in case if you prefer this other approach.

On Wed, Nov 12, 2014 at 1:22 PM, Juraci Paixão Kröhling <
notifications@github.com> wrote:

@ppalaga https://github.com/ppalaga or @lucasponce
https://github.com/lucasponce , could you review it? I was a bit
concerned at first with the possible performance impact of replaceAll, but
as the outcome will always be the same for a long time, it should be
optimized by the VM.


Reply to this email directly or view it on GitHub
#917 (comment).

@jpkrohling
Copy link
Contributor Author

Lucas, the problem is that there might be more than one new line on the string. So, I'd need to iterate to replace all of them. So, in comparison, I think replaceAll is a better solution.

@ppalaga
Copy link
Contributor

ppalaga commented Nov 17, 2014

@jpkrohling +1

@lucasponce
Copy link
Contributor

Hey, the patch is perfect :-).

@ppalaga
Copy link
Contributor

ppalaga commented Nov 21, 2014

Squashed the two commits and merged to master 979cbd2 and 3.8.x 69c37c8

@ppalaga ppalaga closed this Nov 21, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants