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

feat(header): Allow to add specific Host header #32

Merged
merged 1 commit into from
Jun 29, 2021

Conversation

b-viguier
Copy link
Contributor

For optimization purpose, we intend to use a proxy between Php and ES in order to maintain persistent http connections opened. To do this in a common way, the http request must be addressed to the proxy, but using an Host header indicating the actual ES server to reach.

Unfortunately, Host header is not handled correctly, since the ES client already split the input url into scheme, uri… and a host header. Then, when we try to add our own host header, previous one is dropped 😕

The final url is computed in the CurlFactory of guzzle/RingPhp (deprecatde), using Core::url function, but if an url field already exist, the client use it.

The idea here is to compute the final url before to modify headers, in order to keep original host in the url.
Since url field is always computed, tests must be updated to take this new parameter into account.

Copy link
Member

@Oliboy50 Oliboy50 left a comment

Choose a reason for hiding this comment

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

🤷

Copy link

@Benoit382 Benoit382 left a comment

Choose a reason for hiding this comment

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

🤷‍♂️

@b-viguier b-viguier merged commit a659f4e into master Jun 29, 2021
@b-viguier b-viguier deleted the feat/host-header branch June 29, 2021 13:24
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.

None yet

4 participants