Skip to content

Commit

Permalink
fix: only send the basefile name
Browse files Browse the repository at this point in the history
  • Loading branch information
graugans committed Jun 11, 2024
1 parent b86dc1d commit ab78f77
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/swupdater/swupdater.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"mime/multipart"
"net/http"
"os"
"path/filepath"
"strconv"
"time"

Expand Down Expand Up @@ -40,7 +41,7 @@ func (s *SWUpdater) upload(filename string, timeout time.Duration) error {
body := &bytes.Buffer{}
writer := multipart.NewWriter(body)

part, err := writer.CreateFormFile("file", filename)
part, err := writer.CreateFormFile("file", filepath.Base(filename))
if err != nil {
return fmt.Errorf("cannot create form file: %w", err)
}
Expand Down

0 comments on commit ab78f77

Please sign in to comment.