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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[networking/rh] Add strict extension checkinge #7604
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 tasks
This comment was marked as outdated.
This comment was marked as outdated.
pukkandan
reviewed
Jul 16, 2023
pukkandan
force-pushed
the
netv2/strict-extensions
branch
from
July 22, 2023 03:49
de214cf
to
3be2f49
Compare
coletdjnz
commented
Jul 22, 2023
pukkandan
force-pushed
the
netv2/strict-extensions
branch
from
July 22, 2023 04:30
5e924b9
to
f8e5ce7
Compare
coletdjnz
changed the title
[networking/rh] Add strict extension checking
[networking/rh] Add strict extension checkinge
Oct 7, 2023
aalsuwaidi
pushed a commit
to aalsuwaidi/yt-dlp
that referenced
this pull request
Apr 21, 2024
Authored by: coletdjnz Co-authored-by: pukkandan <pukkandan.ytdlp@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This adds strict checks for extensions in RequestHandlers.
Previously the logic meant any extension received was optional to support. However, this causes issues if an extension is required to be supported for the request.
This PR changes it so RequestHandlers have to specify what extensions they support. If they don't support an extension then the request is marked as unsupported by the handler. This is done through removing extensions from a copy of the extensions dict when checking.
Since the architecture is very new, compat is not a concern yet.
I won't do it as part of this PR, but if we need the support for optional extensions there is lots of ways we can go about adding it if need be, such as :
__optional__
extension containing list of optional extensions to ignoreTemplate
Before submitting a pull request make sure you have:
In order to be accepted and merged into yt-dlp each piece of code must be in public domain or released under Unlicense. Check all of the following options that apply:
What is the purpose of your pull request?
Copilot Summary
馃 Generated by Copilot at 8265877
Summary
馃寪馃И馃敡
This pull request adds support for request extensions to the
RequestHandler
class and its subclasses, which are used to perform network requests inyt-dlp
. It also refactors the extension validation tests intest_networking.py
to use a parametrized method.Walkthrough
_SUPPORTED_EXTENSIONS
attribute toRequestHandler
and its subclasses to validate request extensions (link, link, link, link)_check_timeout_extension
method ofRequestHandler
to raiseUnsupportedRequest
exception for unsupported extensions (link)test_networking.py
usingEXTENSION_TESTS
attribute andtest_extension
method (link, link)