file names with colons aren't valid on Windows

Well, Windows has special semantics around that known as streams, but they aren't applicable here.

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
This commit is contained in:
Mohammed Al Sahaf 2025-08-04 00:50:52 +03:00
parent 7668108b5d
commit ed9afb05d8
No known key found for this signature in database

View File

@ -23,6 +23,7 @@ import (
"net"
"os"
"path/filepath"
"strings"
"sync"
"time"
@ -128,8 +129,7 @@ func (nw *NetWriter) WriterKey() string {
func (nw *NetWriter) OpenWriter() (io.WriteCloser, error) {
// Set up WAL directory
baseDir := caddy.AppDataDir()
nw.walDir = filepath.Join(baseDir, "wal", "netwriter", nw.addr.String())
nw.walDir = filepath.Join(baseDir, "wal", "netwriter", strings.Replace(nw.addr.String(), ":", "-", -1))
if err := os.MkdirAll(nw.walDir, 0o755); err != nil {
return nil, fmt.Errorf("failed to create WAL directory: %v", err)
}