mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-26 10:13:39 +08:00
fastcgi: Fill REMOTE_USER with http.auth.user.id placeholder (#3577)
Completing a TODO!
This commit is contained in:
parent
19cc2bd3c3
commit
3fdaf50785
|
@ -226,6 +226,11 @@ func (t Transport) buildEnv(r *http.Request) (map[string]string, error) {
|
|||
reqHost = r.Host
|
||||
}
|
||||
|
||||
authUser := ""
|
||||
if val, ok := repl.Get("http.auth.user.id"); ok {
|
||||
authUser = val.(string)
|
||||
}
|
||||
|
||||
// Some variables are unused but cleared explicitly to prevent
|
||||
// the parent environment from interfering.
|
||||
env = map[string]string{
|
||||
|
@ -240,7 +245,7 @@ func (t Transport) buildEnv(r *http.Request) (map[string]string, error) {
|
|||
"REMOTE_HOST": ip, // For speed, remote host lookups disabled
|
||||
"REMOTE_PORT": port,
|
||||
"REMOTE_IDENT": "", // Not used
|
||||
"REMOTE_USER": "", // TODO: once there are authentication handlers, populate this
|
||||
"REMOTE_USER": authUser,
|
||||
"REQUEST_METHOD": r.Method,
|
||||
"REQUEST_SCHEME": requestScheme,
|
||||
"SERVER_NAME": reqHost,
|
||||
|
|
Loading…
Reference in New Issue
Block a user