googleapis / googleapis/google-cloud-go

storage: HTTP client strips milliseconds from `Custom-Time`

Open
#8,422 1 comment 0 reactions 1 assignee Claimed by @cpriti-os View on GitHub
api: storage priority: p3 type: bug
Dominant language
Go
Stars
4.5k
Forks
1.6k
Avg merge
1d 13h
Merged PRs (30d)
109

Description

**Client**

Storage

**Environment**

Any

**Go Environment**

Go 1.21

**Code**

**Expected behavior**

Milliseconds are supported as per https://cloud.google.com/storage/docs/metadata#custom-time and should not be stripped.

**Actual behavior**

Milliseconds are stripped due to using `time.RFC3339`.

https://github.com/googleapis/google-cloud-go/blob/fbe78a28e01043b059e86c6e960d092b299ac9a4/storage/storage.go#L1090-L1093

**Screenshots**

![image](https://github.com/googleapis/google-cloud-go/assets/25764930/848a9aaf-b291-49ed-8084-e4c0fc69f275)

**Additional context**

gRPC client looks correct:

https://github.com/googleapis/google-cloud-go/blob/fbe78a28e01043b059e86c6e960d092b299ac9a4/storage/storage.go#L1135

https://github.com/googleapis/google-cloud-go/blob/fbe78a28e01043b059e86c6e960d092b299ac9a4/storage/storage.go#L1364-L1370

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.