Compare commits

...

2 Commits

Author SHA1 Message Date
b2bc905e3c chore: mark version 1.0.9 2025-04-15 14:04:50 +07:00
59e68455b6 fix: panic when download file 2025-04-15 03:20:04 +07:00
3 changed files with 14 additions and 5 deletions

View File

@ -62,7 +62,7 @@ services:
Get the latest binary from the [release page](https://github.com/khairul169/garage-webui/releases/latest) according to your OS architecture. For example: Get the latest binary from the [release page](https://github.com/khairul169/garage-webui/releases/latest) according to your OS architecture. For example:
```sh ```sh
$ wget -O garage-webui https://github.com/khairul169/garage-webui/releases/download/1.0.8/garage-webui-v1.0.8-linux-amd64 $ wget -O garage-webui https://github.com/khairul169/garage-webui/releases/download/1.0.9/garage-webui-v1.0.9-linux-amd64
$ chmod +x garage-webui $ chmod +x garage-webui
$ sudo cp garage-webui /usr/local/bin $ sudo cp garage-webui /usr/local/bin
``` ```

View File

@ -146,11 +146,20 @@ func (b *Browse) GetOneObject(w http.ResponseWriter, r *http.Request) {
return return
} }
w.Header().Set("Content-Type", *object.ContentType)
w.Header().Set("Content-Length", strconv.FormatInt(*object.ContentLength, 10))
w.Header().Set("Cache-Control", "max-age=86400") w.Header().Set("Cache-Control", "max-age=86400")
w.Header().Set("Last-Modified", object.LastModified.Format(time.RFC1123)) w.Header().Set("Last-Modified", object.LastModified.Format(time.RFC1123))
if object.ContentType != nil {
w.Header().Set("Content-Type", *object.ContentType)
} else {
w.Header().Set("Content-Type", "application/octet-stream")
}
if object.ContentLength != nil {
w.Header().Set("Content-Length", strconv.FormatInt(*object.ContentLength, 10))
}
if object.ETag != nil {
w.Header().Set("Etag", *object.ETag) w.Header().Set("Etag", *object.ETag)
}
_, err = io.Copy(w, object.Body) _, err = io.Copy(w, object.Body)

View File

@ -1,7 +1,7 @@
{ {
"name": "garage-webui", "name": "garage-webui",
"private": true, "private": true,
"version": "1.0.8", "version": "1.0.9",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev:client": "vite", "dev:client": "vite",