Skip to content

Commit d4a15ac

Browse files
authored
Merge pull request #34 from COSI-Lab/caddy
Fix password prompt on lab network with new reverse proxy
2 parents a0bbf12 + 2fdd2bc commit d4a15ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

handlers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ func socketHandler(w http.ResponseWriter, r *http.Request) {
172172
authenticated := false
173173
if trustedNetworks.Contains(ip) {
174174
// Could be a load balancer, check the X-REAL-IP header
175-
if realIP := r.Header.Get("X-REAL-IP"); realIP != "" {
175+
if realIP := r.Header.Get("X-Forwarded-For"); realIP != "" {
176176
// Check if the real IP is in the trusted network
177177
ip = net.ParseIP(realIP)
178178
if trustedNetworks.Contains(ip) {

0 commit comments

Comments
 (0)