Skip to content

Commit 60f9af6

Browse files
committed
auth now opens prompt
1 parent 6538ed8 commit 60f9af6

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

server/server.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,13 @@ func (s *Server) handle(w http.ResponseWriter, r *http.Request) {
143143
if s.Auth != "" {
144144
u, p, _ := r.BasicAuth()
145145
if s.Auth != u+":"+p {
146+
w.Header().Set("WWW-Authenticate", "Basic")
146147
w.WriteHeader(http.StatusUnauthorized)
147148
w.Write([]byte("Access Denied"))
148149
return
149150
}
150151
}
152+
151153
//handle realtime client connections
152154
if r.URL.Path == "/realtime" {
153155
s.rt.ServeHTTP(w, r)

0 commit comments

Comments
 (0)