-
Notifications
You must be signed in to change notification settings - Fork 24
Fix base_url usage in HttpxRequestAdapter #459
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
Conversation
Fixes microsoft#374 Modify `HttpxRequestAdapter` to use `http_client.base_url` if `base_url` is not explicitly set. * Update the constructor in `packages/http/httpx/kiota_http/httpx_request_adapter.py` to check and use `http_client.base_url` if `base_url` is not provided. * Update the `base_url` property to return `http_client.base_url` if `_base_url` is not set. * Add a test in `packages/http/httpx/tests/test_httpx_request_adapter.py` to verify that `HttpxRequestAdapter` uses `http_client.base_url` if `base_url` is not explicitly set. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/microsoft/kiota-python/issues/374?shareId=XXXX-XXXX-XXXX-XXXX).
andrueastman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution here @svrooij
Any chance you can update the commit message to follow this to help with automation of the changelog/release generation. https://github.com/microsoft/kiota-python/blob/main/CONTRIBUTING.md#commit-message-format
baywet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution!
For others reading, I took the time to check this property actually exists:
https://github.com/encode/httpx/blob/10b7295922741b91a15751029e6ad3e8e5efb9f3/httpx/_client.py#L295
baywet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for making the changes!
|



Fixes #374
Modify
HttpxRequestAdapterto usehttp_client.base_urlifbase_urlis not explicitly set.packages/http/httpx/kiota_http/httpx_request_adapter.pyto check and usehttp_client.base_urlifbase_urlis not provided.base_urlproperty to returnhttp_client.base_urlif_base_urlis not set.packages/http/httpx/tests/test_httpx_request_adapter.pyto verify thatHttpxRequestAdapteruseshttp_client.base_urlifbase_urlis not explicitly set.For more details, open the Copilot Workspace session.