summaryrefslogtreecommitdiff
path: root/iterator.go
diff options
context:
space:
mode:
authorSandro Jäckel <sandro.jaeckel@gmail.com>2026-11-10 18:03:37 +0100
committerSandro Jäckel <sandro.jaeckel@gmail.com>2026-11-10 18:03:51 +0100
commit0738cfbbdbbf898d9e864970924e59d0a2af45e3 (patch)
treefaf2d31bf4438fcf25c9f50f5b87b0d14e65902a /iterator.go
parent537dbec6f63eff137a582dc4e8e7a06d20083237 (diff)
downloadgo-schwift-0738cfbbdbbf898d9e864970924e59d0a2af45e3.tar.gz
Fix that Ceph Swift API emulation contains timezone
Diffstat (limited to 'iterator.go')
-rw-r--r--iterator.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/iterator.go b/iterator.go
index c566f59..9938404 100644
--- a/iterator.go
+++ b/iterator.go
@@ -9,8 +9,18 @@ import (
"net/http"
"strconv"
"strings"
+ "time"
)
+func parseSwiftLastModified(value string) (time.Time, error) {
+ // Swift listings traditionally omit the timezone, which is implicitly UTC.
+ // Some Swift-compatible APIs include a timezone, so try the value as-is first.
+ if parsed, err := time.Parse(time.RFC3339Nano, value); err == nil {
+ return parsed, nil
+ }
+ return time.Parse(time.RFC3339Nano, value+"Z")
+}
+
// iteratorInterface allows iteratorBase to access public attributes of
// ContainerIterator/ObjectIterator.
type iteratorInterface interface {