diff options
author | Christian Pointner <equinox@helsinki.at> | 2016-07-23 01:46:32 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2016-07-23 01:46:32 (GMT) |
commit | 39fd9dd2c8156c9a9f9abc23e6f5398770e44f5d (patch) | |
tree | cd6e6af7387f284f596473dbc97cfa846007a544 /src/rhimportd | |
parent | 732438e3042d299c6dd7c096ba2eaa20035d8466 (diff) |
some cleanup and imrpovments (mainly in the javasctipt test sites
Diffstat (limited to 'src/rhimportd')
-rw-r--r-- | src/rhimportd/main.go | 6 | ||||
-rw-r--r-- | src/rhimportd/routeWeb.go (renamed from src/rhimportd/ctrlWeb.go) | 4 | ||||
-rw-r--r-- | src/rhimportd/uploadWeb.go | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/rhimportd/main.go b/src/rhimportd/main.go index e94476c..72785c0 100644 --- a/src/rhimportd/main.go +++ b/src/rhimportd/main.go @@ -141,9 +141,9 @@ func main() { wg.Add(1) go func() { defer wg.Done() - rhl.Println("starting web-ctrl") - StartControlWeb(webAddr.Get().(string), webStaticDir.Get().(string), conf, db.GetInterface(), sessions.GetInterface()) - rhl.Println("web-ctrl finished") + rhl.Println("starting web-router") + StartWebRouter(webAddr.Get().(string), webStaticDir.Get().(string), conf, db.GetInterface(), sessions.GetInterface()) + rhl.Println("web-router finished") }() } diff --git a/src/rhimportd/ctrlWeb.go b/src/rhimportd/routeWeb.go index bd3d776..22db1d7 100644 --- a/src/rhimportd/ctrlWeb.go +++ b/src/rhimportd/routeWeb.go @@ -44,7 +44,7 @@ func (self webHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { self.H(self.Config, self.DBChan, self.SessionStoreChan, self.trusted, w, r) } -func StartControlWeb(addr, staticDir string, conf *rhimport.Config, db *rddb.DBChan, sessions *rhimport.SessionStoreChan) { +func StartWebRouter(addr, staticDir string, conf *rhimport.Config, db *rddb.DBChan, sessions *rhimport.SessionStoreChan) { http.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir(staticDir)))) // http.Handle("/trusted/simple", webHandler{conf, db, sessions, true, webSimpleHandler}) @@ -52,7 +52,7 @@ func StartControlWeb(addr, staticDir string, conf *rhimport.Config, db *rddb.DBC http.Handle("/public/socket", webHandler{conf, db, sessions, false, webSocketHandler}) http.Handle("/public/upload", webHandler{conf, db, sessions, false, webUploadHandler}) - rhl.Println("web-ctrl: listening on", addr) + rhl.Println("web-router: listening on", addr) server := &http.Server{Addr: addr, ReadTimeout: 2 * time.Hour, WriteTimeout: 2 * time.Hour} server.ListenAndServe() } diff --git a/src/rhimportd/uploadWeb.go b/src/rhimportd/uploadWeb.go index 7d1f460..84605e6 100644 --- a/src/rhimportd/uploadWeb.go +++ b/src/rhimportd/uploadWeb.go @@ -100,7 +100,7 @@ func webUploadParseForm(r *http.Request) (username, sessionid, srcfile string, s func webUploadHandler(conf *rhimport.Config, db *rddb.DBChan, sessions *rhimport.SessionStoreChan, trusted bool, w http.ResponseWriter, r *http.Request) { if r.Method == "GET" { - http.Redirect(w, r, "/static/upload-form.html", http.StatusTemporaryRedirect) + http.Redirect(w, r, "/static/upload.html", http.StatusTemporaryRedirect) return } |