Skip to content

Commit

Permalink
fix: dateTime usage only available in go1.20 (#2982)
Browse files Browse the repository at this point in the history
instead use a simpler normalizer for timestamp
to be user friendly without spaces.

For example

```
selected_files_20091110T230000Z.zip
```
  • Loading branch information
harshavardhana authored Aug 4, 2023
1 parent 6bc4efb commit fed5aa1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cross-compile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion restapi/user_objects.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit fed5aa1

Please sign in to comment.