Skip to content

Commit 4a0949b

Browse files
committed
content: Use path.Join in reading file
1 parent a24c0d7 commit 4a0949b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

content/ContentServer.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"log"
99
"net"
1010
"os"
11+
"path"
1112
"path/filepath"
1213
"srserver/common"
1314
"srserver/conf"
@@ -85,7 +86,7 @@ func (s *ContentServer) processPacket(pack *common.Pack, conn net.Conn) {
8586
pathUrl := pack.ReadString()
8687
filePosition := pack.ReadInt()
8788
size := pack.ReadInt()
88-
data, err := os.ReadFile(conf.ASSETS_PATH + pathUrl)
89+
data, err := os.ReadFile(path.Join(conf.ASSETS_PATH, pathUrl))
8990
if err != nil {
9091
response.SetError(true)
9192
response.WriteProto(&pb.GameException{

0 commit comments

Comments
 (0)