mirror of https://github.com/perkeep/perkeep.git
Start of stripping www.
This commit is contained in:
parent
6132d7f9e7
commit
c321d481a4
|
@ -170,6 +170,15 @@ func (h *gitwebHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type noWwwHandler struct {
|
||||||
|
Handler http.Handler
|
||||||
|
}
|
||||||
|
|
||||||
|
func (h *noWwwHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
|
||||||
|
// TODO: strip www.
|
||||||
|
h.Handler.ServeHTTP(rw, r)
|
||||||
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
readTemplates()
|
readTemplates()
|
||||||
|
@ -208,7 +217,7 @@ func main() {
|
||||||
}
|
}
|
||||||
mux.HandleFunc("/", mainHandler)
|
mux.HandleFunc("/", mainHandler)
|
||||||
|
|
||||||
if err := http.ListenAndServe(*httpAddr, mux); err != nil {
|
if err := http.ListenAndServe(*httpAddr, &noWwwHandler{Handler: mux}); err != nil {
|
||||||
log.Exitf("ListenAndServe %s: %v", *httpAddr, err)
|
log.Exitf("ListenAndServe %s: %v", *httpAddr, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue