Use user request 'Host' replace `conf.Server.ExternalURL` in `internal/route/lfs /batch.go`
Describe the feature
Because gogs may be reverse proxied, accessed by IP address on an internal network, or accessed by multiple different domain names on an external network.
Therefore, these access methods will directly return the conf.Server.ExternalURL address when using LFS.
https://github.com/gogs/gogs/blob/c8cd3e712519c1361b8ee47357ee9e2c777c8179/internal/route/lfs/batch.go#L37
This will cause two problems:
-
When pulling
lfs objects, it will prompt for login again. -
When the
ExternalURLis configured as an internal IP, accessing the domain name from external network will return the configured internal IP when pullingLFS objects.
Describe the solution you'd like
https://github.com/gogs/gogs/blob/c8cd3e712519c1361b8ee47357ee9e2c777c8179/internal/route/lfs/batch.go#L37
Replace conf.Server.ExternalURL with Host in the user's request.
Describe alternatives you've considered
None
Additional context
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct