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

Server and Client disagree on upload-time format #1017

Closed
nickburlett opened this issue Feb 20, 2022 · 0 comments · Fixed by #1018
Closed

Server and Client disagree on upload-time format #1017

nickburlett opened this issue Feb 20, 2022 · 0 comments · Fixed by #1018

Comments

@nickburlett
Copy link
Contributor

When running hackage-mirror, the client code attempts to set the date in ISO 8601 format (%Y-%m-%dT%H:%M:%SZ), but the server expects a locale-based string (%c) as input. This leads to incorrectly mirrored upload-times on the server, and Could not parse upload time errors from the client.

Server code:

case parseTimeMaybe "%c" (unpackUTF8 timeContent) of

Client code:

putPackageUploadTime time = do
let timeStr = formatTime defaultTimeLocale "%Y-%m-%dT%H:%M:%SZ" time
requestPUT (baseURI <//> "upload-time") "text/plain" (packUTF8 timeStr)

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 a pull request may close this issue.

1 participant