mirror of
https://github.com/bolkedebruin/rdpgw.git
synced 2025-08-19 06:53:49 +02:00
Fix check and use 256 bit
This commit is contained in:
parent
0b299619ff
commit
263312dc7b
4 changed files with 9 additions and 7 deletions
|
@ -2,6 +2,7 @@ package client
|
|||
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
"net/http"
|
||||
"strings"
|
||||
)
|
||||
|
@ -31,10 +32,10 @@ func EnrichContext(next http.Handler) http.Handler {
|
|||
ctx = context.WithValue(ctx, ProxyAddressesCtx, proxies)
|
||||
}
|
||||
|
||||
remote := r.Header.Get("REMOTE_ADDR")
|
||||
ctx = context.WithValue(ctx, RemoteAddressCtx, remote)
|
||||
ctx = context.WithValue(ctx, RemoteAddressCtx, r.RemoteAddr)
|
||||
if h == "" {
|
||||
ctx = context.WithValue(ctx, ClientIPCtx, remote)
|
||||
clientIp, _, _ := net.SplitHostPort(r.RemoteAddr)
|
||||
ctx = context.WithValue(ctx, ClientIPCtx, clientIp)
|
||||
}
|
||||
next.ServeHTTP(w, r.WithContext(ctx))
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue