oidc-forward-auth/pkg/forwardauth/utils.go
2020-06-03 16:16:17 +02:00

18 lines
421 B
Go

/*
Copyright (c) 2020 Stefan Kürzeder <info@stivik.de>
This code is licensed under MIT license (see LICENSE for details)
*/
package forwardauth
import (
"fmt"
"net/http"
)
func (fw *ForwardAuth) GetReturnUri(r *http.Request) string {
proto := r.Header.Get("X-Forwarded-Proto")
host := r.Header.Get("X-Forwarded-Host")
path := r.Header.Get("X-Forwarded-Uri")
return fmt.Sprintf("%s://%s%s", proto, host, path)
}