Skip to content

Server and Client disagree on upload-time format #1017

@nickburlett

Description

@nickburlett

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions