Browse Source

Also start up the default HTTPS handler.

pull/25/head
Simon Eisenmann 11 years ago
parent
commit
27695c2a3d
  1. 4
      .gitignore
  2. 11
      src/app/spreed-speakfreely-server/main.go

4
.gitignore vendored

@ -24,3 +24,7 @@ vendor/* @@ -24,3 +24,7 @@ vendor/*
/.sass-cache
/extra
/src/i18n/*.mo
server.key
server.csr
server.crt
server.pem

11
src/app/spreed-speakfreely-server/main.go

@ -121,7 +121,7 @@ func handleRoomView(room string, w http.ResponseWriter, r *http.Request) { @@ -121,7 +121,7 @@ func handleRoomView(room string, w http.ResponseWriter, r *http.Request) {
w.Header().Set("Cache-Control", "private, max-age=0")
// Detect if the request was made with SSL.
ssl := false
ssl := r.TLS != nil
proto, ok := r.Header["X-Forwarded-Proto"]
if ok {
ssl = proto[0] == "https"
@ -357,7 +357,14 @@ func runner(runtime phoenix.Runtime) error { @@ -357,7 +357,14 @@ func runner(runtime phoenix.Runtime) error {
}
}
runtime.DefaultHTTPHandler(r)
err = runtime.DefaultHTTPHandler(r)
if err != nil {
log.Println("Failed to create HTTP handler", err)
}
err = runtime.DefaultHTTPSHandler(r)
if err != nil {
log.Println("Failed to create HTTPS handler", err)
}
return runtime.Start()
}

Loading…
Cancel
Save