mirror of
https://github.com/writeas/writefreely
synced 2025-01-31 21:34:57 +01:00
Also use bind address on standalone redirect
This commit is contained in:
parent
543f6c9ae3
commit
875c758ba2
5
app.go
5
app.go
@ -409,9 +409,10 @@ func Serve() {
|
|||||||
bindAddress = "localhost"
|
bindAddress = "localhost"
|
||||||
}
|
}
|
||||||
if app.cfg.IsSecureStandalone() {
|
if app.cfg.IsSecureStandalone() {
|
||||||
log.Info("Serving redirects on http://localhost:80")
|
log.Info("Serving redirects on http://%s:80", bindAddress)
|
||||||
go func() {
|
go func() {
|
||||||
err = http.ListenAndServe(":80", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
err = http.ListenAndServe(
|
||||||
|
fmt.Sprintf("%s:80", bindAddress), http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
http.Redirect(w, r, app.cfg.App.Host, http.StatusMovedPermanently)
|
http.Redirect(w, r, app.cfg.App.Host, http.StatusMovedPermanently)
|
||||||
}))
|
}))
|
||||||
log.Error("Unable to start redirect server: %v", err)
|
log.Error("Unable to start redirect server: %v", err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user