Fix ONVIF camera connection issues by disabling aiohttp auto-decompression #138
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes connection issues with ONVIF cameras (particularly those using Thingino firmware) that were introduced in v4.0.3. The previous fix for double gzip decompression (#135) caused compatibility issues with certain cameras.
Problem
The previous approach filtered out the
Content-Encoding
header after aiohttp automatically decompressed responses. This caused issues with cameras that:Solution
Instead of filtering headers after aiohttp processes the response, this PR:
auto_decompress=False
to all requestsContent-Encoding
Changes
auto_decompress=False
parameter tosession.post()
andsession.get()
calls_filter_headers()
method that was stripping Content-Encoding headersTesting
Related Issues
Impact
This change ensures compatibility with all ONVIF cameras while still preventing double decompression issues. The responsibility for decompression is now properly delegated to zeep, which can handle it correctly based on the actual Content-Encoding header.