1
0

Set rwx mode to unix socket.

This commit is contained in:
Alexander Andreev 2022-03-07 23:55:00 +04:00
parent 829000764c
commit 344df2ba08
Signed by: Arav
GPG Key ID: 1327FE8A374CC86F

View File

@ -5,6 +5,7 @@ import (
"log" "log"
"net" "net"
"net/http" "net/http"
"os"
"time" "time"
"github.com/julienschmidt/httprouter" "github.com/julienschmidt/httprouter"
@ -66,6 +67,10 @@ func (s *HttpServer) Start(network, address string) error {
return err return err
} }
if listener.Addr().Network() == "unix" {
os.Chmod(address, 0777)
}
go func() { go func() {
if err = s.server.Serve(listener); err != nil && err != http.ErrServerClosed { if err = s.server.Serve(listener); err != nil && err != http.ErrServerClosed {
log.Fatalln(err) log.Fatalln(err)