From fed5aa1599e4ece2025387968bb870a9aa4ba752 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Thu, 3 Aug 2023 20:21:44 -0700 Subject: [PATCH] fix: dateTime usage only available in go1.20 (#2982) instead use a simpler normalizer for timestamp to be user friendly without spaces. For example ``` selected_files_20091110T230000Z.zip ``` --- .github/workflows/cross-compile.yaml | 2 +- restapi/user_objects.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cross-compile.yaml b/.github/workflows/cross-compile.yaml index 6cda05b64e..6ba62dcf9b 100644 --- a/.github/workflows/cross-compile.yaml +++ b/.github/workflows/cross-compile.yaml @@ -26,7 +26,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go-version: [ 1.20.x ] + go-version: [ 1.19.x, 1.20.x ] os: [ ubuntu-latest ] steps: - name: Check out code diff --git a/restapi/user_objects.go b/restapi/user_objects.go index 43a106294f..081799f9ee 100644 --- a/restapi/user_objects.go +++ b/restapi/user_objects.go @@ -741,7 +741,7 @@ func getMultipleFilesDownloadResponse(session *models.Principal, params objectAp defer resp.Close() // indicate it's a download / inline content to the browser, and the size of the object - fileName := "selected_files_" + time.Now().UTC().Format(time.DateTime) + fileName := "selected_files_" + strings.ReplaceAll(strings.ReplaceAll(time.Now().UTC().Format(time.RFC3339), ":", ""), "-", "") rw.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=\"%s.zip\"", fileName)) rw.Header().Set("Content-Type", "application/zip")