This commit is contained in:
2026-02-15 13:13:11 +01:00
parent 8b592db3dd
commit 6a9f94458c
3 changed files with 147 additions and 22 deletions

View File

@@ -9,6 +9,7 @@ import (
"io"
"net/http"
"os/exec"
"strings"
"time"
"github.com/mistifyio/go-zfs"
@@ -121,7 +122,14 @@ func (c *Client) SendIncrementalHTTP(snapshot *zfs.Dataset, base string) error {
}
reqBody, _ := json.Marshal(uploadReq)
resp, err := http.Post(c.config.ServerURL+"/upload", "application/json", bytes.NewBuffer(reqBody))
uploadURL := c.config.ServerURL
// Ensure proper URL format
if !strings.HasSuffix(uploadURL, "/") {
uploadURL += "/"
}
uploadURL += "upload"
resp, err := http.Post(uploadURL, "application/json", bytes.NewBuffer(reqBody))
if err != nil {
return fmt.Errorf("failed to request upload: %v", err)
}