Thanks to visit codestin.com
Credit goes to github.com

Skip to content

tests: fix Accept-Encoding headers in stream_json#4022

Merged
bastimeyer merged 1 commit into
streamlink:masterfrom
bastimeyer:tests/requests-accept-encoding
Sep 16, 2021
Merged

tests: fix Accept-Encoding headers in stream_json#4022
bastimeyer merged 1 commit into
streamlink:masterfrom
bastimeyer:tests/requests-accept-encoding

Conversation

@bastimeyer

Copy link
Copy Markdown
Member

Fixes #4021


requests 2.26.0:
psf/requests@5351469

When the brotli or brotlicffi packages are installed,
urllib3.util.make_headers() inserts ',br' in the Accept-Encoding header
and decodes br from the answers.

@bastimeyer bastimeyer force-pushed the tests/requests-accept-encoding branch from aa284d7 to ae747a1 Compare September 15, 2021 16:15

@back-to back-to left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

sidenote: tests will fail with lower requests version

it is set requests>=2.26.0 so it might be okay.

https://github.com/streamlink/streamlink/blob/master/setup.py#L13

@bastimeyer

Copy link
Copy Markdown
Member Author

If someone installs/packages streamlink with invalid dependencies, then this is not our problem.
The change was introduced in requests 2.26.0, and Streamlink requires at least requests 2.26.0, so this will be fine.

@bastimeyer bastimeyer merged commit 57023b1 into streamlink:master Sep 16, 2021
@bastimeyer bastimeyer deleted the tests/requests-accept-encoding branch September 16, 2021 08:07
Billy2011 added a commit to Billy2011/streamlink-27 that referenced this pull request Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tests failing on tests/test_stream_json.py

2 participants