Skip to content

Commit

Permalink
auth now opens prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
jpillora committed Sep 2, 2015
1 parent 6538ed8 commit 60f9af6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,13 @@ func (s *Server) handle(w http.ResponseWriter, r *http.Request) {
if s.Auth != "" {
u, p, _ := r.BasicAuth()
if s.Auth != u+":"+p {
w.Header().Set("WWW-Authenticate", "Basic")
w.WriteHeader(http.StatusUnauthorized)
w.Write([]byte("Access Denied"))
return
}
}

//handle realtime client connections
if r.URL.Path == "/realtime" {
s.rt.ServeHTTP(w, r)
Expand Down

0 comments on commit 60f9af6

Please sign in to comment.