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

delete this misleading library #19

Open
batara666 opened this issue Dec 29, 2020 · 1 comment
Open

delete this misleading library #19

batara666 opened this issue Dec 29, 2020 · 1 comment

Comments

@batara666
Copy link

batara666 commented Dec 29, 2020

we should more educate people about *http.Request, *gin.Context and Gin's Midleware

@TJM
Copy link

TJM commented Feb 24, 2021

It would be nice if there was an easy way to retrieve this information, but this module appears to take into account forwarded connections (via Proxy), among other things. Ideally, we could just get this information from the context, but I couldn't easily find it... I had started with something like:

	var baseURL string
	if c.Request.TLS == nil {
		baseURL = "http://"
	} else {
		baseURL = "https://"
	}
	baseURL += c.Request.Host // + c.Request.RequestURI
	log.Info("BaseURL: ", baseURL)

... which sorta worked until I deployed into K8s, where the load balancer was offloading https, then I needed to start looking at headers, and stumbled into this module. Instead of deleting it, we should probably "improve" it??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants