tweak host detection
parent
5b7c9fae97
commit
1193dc8776
|
|
@ -28,8 +28,8 @@ func ToTemplateVars(req *http.Request, shortcuts map[string]string) TemplateVari
|
|||
}
|
||||
|
||||
if host == "" {
|
||||
if host = req.Header.Get("X-Forwarded-For"); host == "" {
|
||||
host = req.Host
|
||||
if host = req.Host; host == "" {
|
||||
host = req.Header.Get("X-Forwarded-For")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
</head>
|
||||
<body style="display: flex; width: 100%; align-items: center; flex-direction: column;">
|
||||
<div style="display: flex; align-content: center; flex-direction: column; min-width: 40%;">
|
||||
<h1>Hello Internet from {{ .Host }}</h1>
|
||||
<h1>Hello internet - {{ .Host }} greets you.</h1>
|
||||
<!-- Add search box form here for testing/adding shortcuts -->
|
||||
<form action="/search" method="GET" style="display:flex; margin-bottom: 10px; width: 100%;">
|
||||
<input type="text" name="q" value="" style="flex-grow: 1;"/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue