fix: Use IP from X-Forwarded-For when available
This commit is contained in:
parent
5fb29668c8
commit
d724154635
1 changed files with 1 additions and 1 deletions
2
main.go
2
main.go
|
@ -124,7 +124,7 @@ func (h *Handler) CreateHandler(wr http.ResponseWriter, req *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
req.ParseForm()
|
req.ParseForm()
|
||||||
code, err := h.GetCode(req.Form.Get("url"), req.RemoteAddr)
|
code, err := h.GetCode(req.Form.Get("url"), ip)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
Render(wr, map[string]string{"error": err.Error()})
|
Render(wr, map[string]string{"error": err.Error()})
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue