Skip to content

Conversation

vruello
Copy link

@vruello vruello commented Apr 17, 2025

Currently, the path_prefix configuration (i.e. the url path) of the ES host is removed by the httpx client. This PR adds it.

path_prefix is set by client_utils.url_to_node_config (https://github.com/elastic/elastic-transport-python/blob/main/elastic_transport/client_utils.py#L187). It is either "" if the url path is empty or "/", or the url path itself.

For example, if you configure host to be http://localhost:9092/test and run a search() query, you'll see an HTTP request sent to http://localhost:9092/_search, without the "test" prefix.

This is very useful when elastic endpoints are behind a reverse proxy with a specific path.

Copy link

cla-checker-service bot commented Apr 17, 2025

💚 CLA has been signed

@pquentin
Copy link
Member

Thank you! Can you please sign the CLA?

@vruello
Copy link
Author

vruello commented Apr 30, 2025

Hi! Sorry for the delay. I just signed the CLA.

@vruello
Copy link
Author

vruello commented Apr 30, 2025

By the way, do you think this commit could be backported to 8.x?

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