actually do handler
This commit is contained in:
@@ -48,7 +48,7 @@ func (s *Server) Routes() error {
|
|||||||
handler := route.handler
|
handler := route.handler
|
||||||
handler = s.gzip(handler)
|
handler = s.gzip(handler)
|
||||||
handler = s.oauth(handler)
|
handler = s.oauth(handler)
|
||||||
if err := s.Add(route.path, route.handler); err != nil {
|
if err := s.Add(route.path, handler); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -152,7 +152,6 @@ func (s *Server) _static(w http.ResponseWriter, r *http.Request) error {
|
|||||||
func (s *Server) oauth(h http.HandlerFunc) http.HandlerFunc {
|
func (s *Server) oauth(h http.HandlerFunc) http.HandlerFunc {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
if config.OAuth != "" {
|
if config.OAuth != "" {
|
||||||
log.Println("oauth'ing", r.Host)
|
|
||||||
err := oauth2client.Authenticate(config.OAuth, r.Host, w, r)
|
err := oauth2client.Authenticate(config.OAuth, r.Host, w, r)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println("oauth failure", err)
|
log.Println("oauth failure", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user