Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use user request 'Host' replace conf.Server.ExternalURL in internal/route/lfs /batch.go #7741

Open
1 task done
whtiehack opened this issue May 9, 2024 · 0 comments
Open
1 task done
Labels
🎯 feature Categorizes as related to a new feature

Comments

@whtiehack
Copy link

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.

baseHref := fmt.Sprintf("%s%s/%s.git/info/lfs/objects/basic", conf.Server.ExternalURL, owner.Name, repo.Name)


This will cause two problems:

  1. When pulling lfs objects, it will prompt for login again.

  2. When the ExternalURL is configured as an internal IP, accessing the domain name from external network will return the configured internal IP when pulling LFS objects.

Describe the solution you'd like

baseHref := fmt.Sprintf("%s%s/%s.git/info/lfs/objects/basic", conf.Server.ExternalURL, owner.Name, repo.Name)

Replace conf.Server.ExternalURL with Host in the user's request.

Describe alternatives you've considered

None

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@whtiehack whtiehack added the 🎯 feature Categorizes as related to a new feature label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎯 feature Categorizes as related to a new feature
Projects
None yet
Development

No branches or pull requests

1 participant