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

Path in hosts configuration is ignored #1377

Closed
mikevrind opened this issue Oct 28, 2023 · 2 comments
Closed

Path in hosts configuration is ignored #1377

mikevrind opened this issue Oct 28, 2023 · 2 comments

Comments

@mikevrind
Copy link

mikevrind commented Oct 28, 2023

Summary of problem or feature request

I need to use a host in which Elastic is available via a subfolder. The host is being carried on correctly until the Transport class.
There it uses the Node object to build a connection URI but the path part of the configured host is not being used.

Code snippet of problem

private function setupConnectionUri(Node $node, RequestInterface $request): RequestInterface
    {
        $uri = $node->getUri();
        
        return $request->withUri(
            $request->getUri()
                ->withHost($uri->getHost())
                ->withPort($uri->getPort())
                ->withScheme($uri->getScheme())
         );
    }

System details

  • Operating System: RHEL7
  • PHP Version: 8.1
  • ES-PHP client version 8.10.0
  • Elasticsearch version: 7.17.14
@mikevrind
Copy link
Author

Also made a PR: elastic/elastic-transport-php#20

@ezimuel
Copy link
Contributor

ezimuel commented Nov 7, 2023

Fixed in elastic/elastic-transport-php#21

@ezimuel ezimuel closed this as completed Nov 7, 2023
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