v0.1.4 Fix bug with host routing
This commit is contained in:
parent
13ed1c5cc2
commit
50498b406c
|
@ -263,14 +263,14 @@ const NewInstall = () => {
|
||||||
multiline
|
multiline
|
||||||
name="TLSKey"
|
name="TLSKey"
|
||||||
label="Private Certificate"
|
label="Private Certificate"
|
||||||
placeholder="-----BEGIN CERTIFICATE-----\nMIIEowIBwIBAA...."
|
placeholder="-----BEGIN RSA PRIVATE KEY-----\nQCdYIUkYi...."
|
||||||
formik={formik}
|
formik={formik}
|
||||||
/>
|
/>
|
||||||
<CosmosInputText
|
<CosmosInputText
|
||||||
multiline
|
multiline
|
||||||
name="TLSCert"
|
name="TLSCert"
|
||||||
label="Public Certificate"
|
label="Public Certificate"
|
||||||
placeholder="-----BEGIN RSA PRIVATE KEY-----\nQCdYIUkYi...."
|
placeholder="-----BEGIN CERTIFICATE-----\nMIIEowIBwIBAA...."
|
||||||
formik={formik}
|
formik={formik}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "cosmos-server",
|
"name": "cosmos-server",
|
||||||
"version": "0.1.3",
|
"version": "0.1.4",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "test-server.js",
|
"main": "test-server.js",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
|
|
@ -183,7 +183,14 @@ func StartServer() {
|
||||||
router.Use(middleware.Logger)
|
router.Use(middleware.Logger)
|
||||||
router.Use(utils.SetSecurityHeaders)
|
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)
|
http.Redirect(w, r, "/ui", http.StatusMovedPermanently)
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue