feat: Handle X-Forwarded-Proto header
All checks were successful
/ pre-commit (push) Successful in 1m40s
All checks were successful
/ pre-commit (push) Successful in 1m40s
Fixes #39. Signed-off-by: Julien Riou <julien@riou.xyz>
This commit is contained in:
parent
de24146991
commit
acfad88cb8
2 changed files with 5 additions and 2 deletions
|
@ -177,8 +177,11 @@ func (h *CreateNoteWithFormHandler) ServeHTTP(w http.ResponseWriter, r *http.Req
|
|||
}
|
||||
|
||||
logger.Debug("building note url")
|
||||
|
||||
var scheme = "http://"
|
||||
if r.TLS != nil {
|
||||
if proto := r.Header.Get("X-Forwarded-Proto"); proto != "" {
|
||||
scheme = proto + "://"
|
||||
} else if r.TLS != nil {
|
||||
scheme = "https://"
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue