From f78a06befe2ccc89c2a16207c343a880a24df93f Mon Sep 17 00:00:00 2001 From: zijiren233 Date: Wed, 1 Nov 2023 00:02:07 +0800 Subject: [PATCH] Fix: room hot list creator name --- internal/conf/reatLimit.go | 4 ++-- internal/op/rooms.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/conf/reatLimit.go b/internal/conf/reatLimit.go index 0c3c1be..0beca19 100644 --- a/internal/conf/reatLimit.go +++ b/internal/conf/reatLimit.go @@ -4,8 +4,8 @@ type RateLimitConfig struct { Enable bool `yaml:"enable" lc:"default: false" env:"SERVER_RATE_LIMIT_ENABLE"` Period string `yaml:"period" env:"SERVER_RATE_LIMIT_PERIOD"` Limit int64 `yaml:"limit" env:"SERVER_RATE_LIMIT_LIMIT"` - TrustForwardHeader bool `yaml:"trust_forward_header" lc:"default: false" hc:"configure the limiter to trust X-Real-IP and X-Forwarded-For headers. Please be advised that using this option could be insecure (ie: spoofed) if your reverse proxy is not configured properly to forward a trustworthy client IP." env:"SERVER_TRUST_FORWARD_HEADER"` - TrustedClientIPHeader string `yaml:"trusted_client_ip_header" hc:"configure the limiter to use a custom header to obtain user IP. Please be advised that using this option could be insecure (ie: spoofed) if your reverse proxy is not configured properly to forward a trustworthy client IP." env:"SERVER_TRUSTED_CLIENT_IP_HEADER"` + TrustForwardHeader bool `yaml:"trust_forward_header" lc:"default: false" hc:"configure the limiter to trust X-Real-IP and X-Forwarded-For headers. Please be advised that using this option could be insecure (ie: spoofed) if your reverse proxy is not configured properly to forward a trustworthy client IP." env:"SERVER_RATE_LIMIT_TRUST_FORWARD_HEADER"` + TrustedClientIPHeader string `yaml:"trusted_client_ip_header" hc:"configure the limiter to use a custom header to obtain user IP. Please be advised that using this option could be insecure (ie: spoofed) if your reverse proxy is not configured properly to forward a trustworthy client IP." env:"SERVER_RATE_LIMIT_TRUSTED_CLIENT_IP_HEADER"` } func DefaultRateLimitConfig() RateLimitConfig { diff --git a/internal/op/rooms.go b/internal/op/rooms.go index 2111158..f4cd983 100644 --- a/internal/op/rooms.go +++ b/internal/op/rooms.go @@ -228,7 +228,7 @@ func GetRoomHeapInCacheWithoutHidden() RoomHeap { RoomName: v.Name, PeopleNum: v.ClientNum(), NeedPassword: v.NeedPassword(), - Creator: v.CreatorID, + Creator: GetUserName(v.CreatorID), CreatedAt: v.CreatedAt.UnixMilli(), }) }