sabberworm commented on code in PR #1054:
URL: https://github.com/apache/tomcat/pull/1054#discussion_r3871873897
##########
java/org/apache/tomcat/util/http/FastHttpDateFormat.java:
##########
@@ -146,13 +158,9 @@ public static long parseDate(String value) {
long date = -1;
for (int i = 0; (date == -1) && (i < httpParseFormats.length); i++) {
- try {
- date = httpParseFormats[i].parse(value).getTime();
- updateParseCache(value, Long.valueOf(date));
- } catch (ParseException e) {
- // Ignore
- }
+ date = httpParseFormats[i].tryParseDate(value);
}
+ updateParseCache(value, Long.valueOf(date));
Review Comment:
Now this is also called for values that failed to parse. Not sure if that’s
better or worse. IMHO it makes sense to also cache these, since they’re the
most expensive to calculate since they have to be rejected by all the parsers.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]