Ensure 304 status code does not throw, but returns None instead#460
Ensure 304 status code does not throw, but returns None instead#460baywet merged 12 commits intomicrosoft:mainfrom
Conversation
Fixes microsoft#363 Add handling for 304 responses without a location header in request adapter. * Modify `packages/http/httpx/kiota_http/httpx_request_adapter.py` to include a check for 304 status code in `_should_return_none` method. * Return True if the status code is 304 and there is no location header. * Add a unit test in `packages/http/httpx/tests/test_httpx_request_adapter.py` to verify that the request adapter returns null and does not throw for a 304 response without a location header. * Create a mock 304 response without a location header. * Ensure the unit test checks that the request adapter returns null for the 304 response. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/microsoft/kiota-python/issues/363?shareId=XXXX-XXXX-XXXX-XXXX).
This comment was marked as outdated.
This comment was marked as outdated.
|
Conflicts have been resolved. A maintainer will take a look shortly. |
baywet
left a comment
There was a problem hiding this comment.
Thank you for making the changes!
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
Signed-off-by: Vincent Biret <vibiret@microsoft.com>
|
baywet
left a comment
There was a problem hiding this comment.
geee... finally. Python linting is quite strict.
Which is why I added the tasks to the dev container so you can run them locally 😄 |
yeah I was too lazy for that, run the tool, push, let the CI tell me what's wrong while I do something else. A bit noisy for others though... |



Fixes #363
Add handling for 304 responses without a location header in request adapter.
packages/http/httpx/kiota_http/httpx_request_adapter.pyto include a check for 304 status code in_should_return_nonemethod.packages/http/httpx/tests/test_httpx_request_adapter.pyto verify that the request adapter returns null and does not throw for a 304 response without a location header.For more details, open the Copilot Workspace session.