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

Do not use INI [proxy] settings when connecting to localhost or 127.0.0.1 #8338

Merged
merged 2 commits into from Jul 13, 2015

Conversation

mattab
Copy link
Member

@mattab mattab commented Jul 12, 2015

Refactored local hostnames into static helper in Url

fixes #8272

@mattab mattab added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Jul 12, 2015
@mattab mattab added this to the 2.14.1 milestone Jul 12, 2015
@mattab mattab added the Needs Review PRs that need a code review label Jul 12, 2015
*/
public static function getLocalHostnames()
{
return array('localhost', '127.0.0.1', '::1', '[::1]');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And what about using $_SERVER['SERVER_ADDR'] and gethostbyname(gethostname())?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer not to use those because the IP and hostname would depend on the client issuing the request and a visitor could be eg. from a different country or anywhere, which does not qualify as a "localhost" address....

but it's true that maybe this PR won't completely fix the issue reported in #8253 although it should fix #8272

@barbushin
Copy link
Contributor

All my notices are not so critical, so PR looks good to merge.

mattab pushed a commit that referenced this pull request Jul 13, 2015
 Do not use INI [proxy] settings when connecting to localhost or 127.0.0.1
@mattab mattab merged commit ba0b62a into master Jul 13, 2015
@mattab mattab deleted the 8272_no_proxy_for_local_urls branch July 13, 2015 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants