mirror of
https://github.com/caddyserver/caddy.git
synced 2025-08-07 09:04:04 -04:00
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:
parent
7668108b5d
commit
ed9afb05d8
@ -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)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user