mirror of
https://github.com/caddyserver/caddy.git
synced 2025-12-08 06:09:53 +00: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
1 changed files with 2 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue