From 50498b406cccc183763e3c2fb51791841391faf5 Mon Sep 17 00:00:00 2001 From: Yann Stepienik Date: Sat, 1 Apr 2023 16:46:17 +0100 Subject: [PATCH] v0.1.4 Fix bug with host routing --- client/src/pages/newInstall/newInstall.jsx | 6 +++--- package.json | 2 +- src/httpServer.go | 9 ++++++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/client/src/pages/newInstall/newInstall.jsx b/client/src/pages/newInstall/newInstall.jsx index 4f7c95d..f28e278 100644 --- a/client/src/pages/newInstall/newInstall.jsx +++ b/client/src/pages/newInstall/newInstall.jsx @@ -263,14 +263,14 @@ const NewInstall = () => { multiline name="TLSKey" label="Private Certificate" - placeholder="-----BEGIN CERTIFICATE-----\nMIIEowIBwIBAA...." + placeholder="-----BEGIN RSA PRIVATE KEY-----\nQCdYIUkYi...." formik={formik} - /> + /> diff --git a/package.json b/package.json index 7aafe63..9df1502 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cosmos-server", - "version": "0.1.3", + "version": "0.1.4", "description": "", "main": "test-server.js", "bugs": { diff --git a/src/httpServer.go b/src/httpServer.go index bf5ed97..644d3a5 100644 --- a/src/httpServer.go +++ b/src/httpServer.go @@ -183,7 +183,14 @@ func StartServer() { router.Use(middleware.Logger) router.Use(utils.SetSecurityHeaders) - router.HandleFunc("/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + router.Methods("GET", + "POST", + "PUT", + "DELETE", + "PATCH", + "OPTIONS", + "HEAD", + ).Host(config.Hostname).Subrouter().HandleFunc("/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { http.Redirect(w, r, "/ui", http.StatusMovedPermanently) }))