Skip to content

Rfc3339 parser allows invalid datetimes to be parsed. #720

Closed
@Firstyear

Description

@Firstyear
fn main() {

    let valid = OffsetDateTime::parse("2020-09-25T01:22:02+00:00", &Rfc3339)
        .unwrap();

    let invalid = OffsetDateTime::parse("2020-09-25 01:22:02+00:00", &Rfc3339)
        .unwrap_err();
}

https://datatracker.ietf.org/doc/html/rfc3339#section-5.6

Works in 3.36 but not 3.37. As I'm reading RFC3339, the T is required, and a space isn't valid. date-time = full-date "T" full-time

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions