mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
add trusted proxy for parsing client IPs (#115)
This commit is contained in:
@@ -122,6 +122,11 @@ func New(cfg *config.Config, db db.DB, logger *logrus.Logger) (Router, error) {
|
||||
engine := gin.Default()
|
||||
engine.MaxMultipartMemory = 8 << 20 // 8 MiB
|
||||
|
||||
// set up IP forwarding via x-forward-* headers.
|
||||
if err := engine.SetTrustedProxies(cfg.TrustedProxies); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// enable cors on the engine
|
||||
if err := useCors(cfg, engine); err != nil {
|
||||
return nil, err
|
||||
|
Reference in New Issue
Block a user