From 07abb224e66b1336d2edd11d9e21632dadeebd58 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Fri, 13 Nov 2015 22:12:30 -0800 Subject: [PATCH] update: Support backward compatible date formate --- update-main.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/update-main.go b/update-main.go index 8aa9d933..56bd1208 100644 --- a/update-main.go +++ b/update-main.go @@ -18,6 +18,7 @@ package main import ( "encoding/json" + "net/http" "runtime" "strings" "time" @@ -145,7 +146,10 @@ func getExperimentalUpdate() { fatalIf(probe.NewError(e), "Unable to decode experimental update notification.") latest, e := time.Parse(time.RFC3339, experimentals.BuildDate) - fatalIf(probe.NewError(e), "Unable to parse BuildDate.") + if e != nil { + latest, e = time.Parse(http.TimeFormat, experimentals.BuildDate) + fatalIf(probe.NewError(e), "Unable to parse BuildDate.") + } if latest.IsZero() { fatalIf(errDummy().Trace(), "Unable to validate any experimental update available at this time. Please open an issue at https://github.com/minio/mc/issues") @@ -192,7 +196,10 @@ func getReleaseUpdate() { fatalIf(probe.NewError(e), "Unable to decode update notification.") latest, e := time.Parse(time.RFC3339, updates.BuildDate) - fatalIf(probe.NewError(e), "Unable to parse BuildDate.") + if e != nil { + latest, e = time.Parse(http.TimeFormat, updates.BuildDate) + fatalIf(probe.NewError(e), "Unable to parse BuildDate.") + } if latest.IsZero() { fatalIf(errDummy().Trace(), "Unable to validate any update available at this time. Please open an issue at https://github.com/minio/mc/issues")