From 903a9999c04f1e2478b71771003a450591ca7ab0 Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Sun, 31 Oct 2021 23:08:43 +0100 Subject: [PATCH] Set published when empty --- cmd/eksterd/micropub.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/eksterd/micropub.go b/cmd/eksterd/micropub.go index 4acfb7f..9ed1a29 100644 --- a/cmd/eksterd/micropub.go +++ b/cmd/eksterd/micropub.go @@ -67,6 +67,10 @@ func (h *micropubHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { http.Error(w, err.Error(), 400) return } + log.Printf("Item published: %s", item.Published) + if item.Published == "" { + item.Published = time.Now().Format(time.RFC3339) + } item.Read = false newID, err := generateItemID(conn, channel)