-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue #11648 - Introducing HttpDateTime class. #11672
Conversation
+ Introduces HTTP (and Cookie) Date/Time parsing according to spec algorithms. + Introduces formatting according to spec mandated preferred RFC 1123 format. + Deprecate DateParser
As of commit f101889 these are the performance numbers.
The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, on re-review, a couple of things...
jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/HttpDateTime.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/HttpDateTime.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/HttpDateTime.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/HttpDateTime.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/HttpDateTime.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/HttpDateTime.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/HttpDateTime.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
another niggle
jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/HttpDateTime.java
Outdated
Show resolved
Hide resolved
continue; // skip blank tokens | ||
|
||
// RFC 6265 - Section 5.1.1 - Step 2.1 - time (00:00:00) | ||
if (hour == (-1) && token.length() == 8 && token.charAt(2) == ':' && token.charAt(5) == ':') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please get rid of parens around -1
everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/HttpDateTime.java
Outdated
Show resolved
Hide resolved
jetty-core/jetty-http/src/main/java/org/eclipse/jetty/http/HttpDateTime.java
Outdated
Show resolved
Hide resolved
*/ | ||
public static String format(TemporalAccessor datetime) | ||
{ | ||
return DateTimeFormatter.RFC_1123_DATE_TIME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh interesting! IT does the hard coded "GMT" for us, even if we pass in "UTC". Nice! Well not nice... ugly history in evidence... but at least it is consistent. The time is in UTC, but just reported as "GMT"!
This an alternative implementation for PR #11658
Fixes: #11648