ChristopherSchultz commented on PR #681: URL: https://github.com/apache/tomcat/pull/681#issuecomment-1864951885
> Re 4: I think that if one is wise enough to write a RegExp, they could use "|" to combine several patterns, and do not really need splitting by comma. Or do you envision a use case, where different types of patterns are used together, and one of them is a regular expression? > > I mean: do a .startsWith("/") && .endsWith("/") test before calling String.split(). Skip splitting. > > ```diff > - if (null == patterns || 0 == patterns.trim().length()) { > + if (null == patterns || 0 == (patterns = patterns.trim()).length()) { > ... > - String values[] = patterns.split(","); > + String values[] = patterns.startsWith("/") && patterns.endsWith("/") ? new String[]{ patterns } : patterns.split(","); > ``` Yes, I was thinking that someone could specify a series of checks like `*.css, /.*includes.*/, *.png`. I suppose if you are going to use a regular expression, maybe the entire pattern should be used since regex is very expensive already. -- 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. To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org