mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 17:42:25 -05:00
add trusted proxy for parsing client IPs (#115)
This commit is contained in:
parent
651f12cdfb
commit
e2757ae676
7 changed files with 339 additions and 13 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue