Skip to content

DateCache.formatNow(long now) does not honor the passed in long #4606

@joakime

Description

@joakime

Jetty version
All versions

Java version
All versions

OS type/version
All versions

Description

If using DateCache.formatNow(long now) ...

https://github.com/eclipse/jetty.project/blob/7ce14a419fd1c7cec42d808ac3e6fd862ce517b4/jetty-util/src/main/java/org/eclipse/jetty/util/DateCache.java#L212-L222

And the passed in long now is a cache miss, the Tick formatTick(long now) is used to generate a new Tick for caching reasons.

But it doesn't honor the passed in long now when regenerating the Tick.

https://github.com/eclipse/jetty.project/blob/7ce14a419fd1c7cec42d808ac3e6fd862ce517b4/jetty-util/src/main/java/org/eclipse/jetty/util/DateCache.java#L234-L247

Line 242 just blindly goes Instant.now(), when it probably should use Instant.ofEpochMilli(now)

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugFor general bugs on Jetty side

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions