summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Chabowski <kevin@kch42.de>2014-03-27 15:29:29 +0100
committerKevin Chabowski <kevin@kch42.de>2014-03-27 23:51:08 +0100
commite1725316e8d04124ba4409807bcc3e6189afc167 (patch)
tree41f5c6273ebbf5258f140c835dba41be66d77dda
parentccdba88b73eae78984e31831079ff8798c2ddd59 (diff)
downloadsimplechat-e1725316e8d04124ba4409807bcc3e6189afc167.tar.gz
simplechat-e1725316e8d04124ba4409807bcc3e6189afc167.tar.bz2
simplechat-e1725316e8d04124ba4409807bcc3e6189afc167.zip
Prevent chatrooms with empty names
-rw-r--r--main.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/main.go b/main.go
index 4efcc9c..33119e4 100644
--- a/main.go
+++ b/main.go
@@ -31,8 +31,8 @@ func main() {
r := mux.NewRouter()
r.HandleFunc("/", Home)
r.PathPrefix("/static").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir(*staticpath))))
- r.HandleFunc("/chat/{chatroom}/", Chatpage)
- r.HandleFunc("/chat/{chatroom}/socket", AcceptWebSock)
+ r.HandleFunc("/chat/{chatroom:.+}/", Chatpage)
+ r.HandleFunc("/chat/{chatroom:.+}/socket", AcceptWebSock)
http.Handle("/", r)
http.ListenAndServe(*laddr, nil)
}