-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
IsLocalHost only works with default ports #487
Comments
mmatczuk
added a commit
to mmatczuk/goproxy
that referenced
this issue
Nov 7, 2022
Without this patch IsLocalHost does not work for URLs with port specified i.e. it works for `http://localhost` but does not work for `http://localhost:80` or `http://localhost:10000`. Fixes elazarl#487
mmatczuk
added a commit
to mmatczuk/goproxy
that referenced
this issue
Nov 7, 2022
Without this patch IsLocalHost does not work for URLs with port specified i.e. it works for `http://localhost` but does not work for `http://localhost:80` or `http://localhost:10000`. Fixes elazarl#487
It seems this is not the only problem the |
mmatczuk
added a commit
to mmatczuk/goproxy
that referenced
this issue
Nov 7, 2022
Without this patch IsLocalHost does not work for URLs with port specified i.e. it works for `http://localhost` but does not work for `http://localhost:80` or `http://localhost:10000`. Fixes elazarl#487
mmatczuk
added a commit
to mmatczuk/goproxy
that referenced
this issue
Nov 8, 2022
Without this patch IsLocalHost does not work for URLs with port specified i.e. it works for `http://localhost` but does not work for `http://localhost:80` or `http://localhost:10000`. Fixes elazarl#487
mmatczuk
added a commit
to mmatczuk/goproxy
that referenced
this issue
Nov 9, 2022
Without this patch IsLocalHost does not work for URLs with port specified i.e. it works for `http://localhost` but does not work for `http://localhost:80` or `http://localhost:10000`. Fixes elazarl#487
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It was originally observed in #289.
The
IsLocalHost
function usesreq.URL.Host
goproxy/dispatcher.go
Line 105 in a0805db
It can be host or host:port.
In the latter case the check simply does not work.
It's not documented and it simply looks like a bug.
It should be using the Hostname function instead.
The text was updated successfully, but these errors were encountered: