diff options
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 } |