func TestNoCache(t *testing.T) { mux := routing.NewSessionMux2("") mux.HFilterFunc("^.*$", NoCacheFilter) mux.HFunc("^.*$", func(hs *routing.HTTPSession) routing.HResult { return routing.HRES_RETURN }) ts := httptest.NewServer(mux) util.HGet("%v", ts.URL) }
func NewJcrMux() *routing.SessionMux { mux := routing.NewSessionMux2("/jcr") cors := filter.NewCORS() cors.AddSite("*") mux.HFilter("^/(conf|store|jcr)(\\?.*)?$", cors) mux.HFunc("^/conf(\\?.*)?$", JcrConf) mux.HFunc("^/store(\\?.*)?$", JcrStore) mux.HFunc("^/jcr\\.js(\\?.*)?$", JcrJs) mux.HFunc("^/exit(\\?.*)?$", JcrExit) return mux }