Skip to content
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

fix: escape structured data and enforce micro precision per rfc5424 #81

Merged
merged 2 commits into from
May 1, 2024

Conversation

ctrlaltf24
Copy link
Contributor

@ctrlaltf24 ctrlaltf24 commented Apr 29, 2024

  • ensure timestamp's sub-seconds is no more than 6 digits of precision (by using microseconds)
    • per section 6 of rfc5424
      TIME-SECFRAC    = "." 1*6DIGIT

(also re-iterated in section 6.2.3)

   Example 5 - An Invalid TIMESTAMP

         2003-08-24T05:14:15.000000003-07:00

   This example is nearly the same as Example 4, but it is specifying
   TIME-SECFRAC in nanoseconds.  This results in TIME-SECFRAC being
   longer than the allowed 6 digits, which invalidates it.
  • escape structured data values
    • per section 6.3.3 of rfc5424
   Inside PARAM-VALUE, the characters '"' (ABNF %d34), '\' (ABNF %d92),
   and ']' (ABNF %d93) MUST be escaped. 

Resolves: #73

…5424

- ensure timestamp's sub-seconds is no more than 6 digits of precision
- escape structured data values
src/format.rs Outdated Show resolved Hide resolved
@Geal Geal merged commit f9bbd4c into Geal:master May 1, 2024
@ctrlaltf24 ctrlaltf24 deleted the fix-escape-structured-data-values branch May 1, 2024 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid timestamp format for RFC 5424
2 participants