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

Fix #1176 adding includePortInHostHeader in fromConfig #1181

Merged
merged 2 commits into from
Dec 7, 2021
Merged

Fix #1176 adding includePortInHostHeader in fromConfig #1181

merged 2 commits into from
Dec 7, 2021

Conversation

ezimuel
Copy link
Contributor

@ezimuel ezimuel commented Dec 6, 2021

This PR fixes #1176 adding includePortInHostHeader support in ClientBuilder::fromConfig.

@@ -197,7 +197,8 @@ public static function fromConfig(array $config, bool $quiet = false): Client
{
$builder = new static;
foreach ($config as $key => $value) {
$method = "set$key";
$allowedMethods = ['includePortInHostHeader']; // other available methods
Copy link

Choose a reason for hiding this comment

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

Might it be better to move this hard-coded list of allowed methods up to class scope? It would be potentially easier to find there, and wouldn't get created for each loop iteration.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good suggestion, I'll move it using a class constant.

Copy link

@technige technige left a comment

Choose a reason for hiding this comment

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

Perfetto!

@ezimuel ezimuel merged commit 02b24c7 into elastic:7.16 Dec 7, 2021
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

Successfully merging this pull request may close these issues.

2 participants