Skip to content
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

Ignore non-ASCII ALPN [#374]. #467

Merged
merged 1 commit into from
Feb 17, 2024
Merged

Ignore non-ASCII ALPN [#374]. #467

merged 1 commit into from
Feb 17, 2024

Conversation

rthalley
Copy link
Contributor

@rthalley rthalley commented Feb 6, 2024

Much like PR #375, this ignores non-ASCII APLNs, but unlike #375 there is an explicit protocol for skipping things when pulling a list. The ALPN decoder catches decoding exceptions and uses the protocol to say "ignore this list element". There
is also a test.

We could probably accept anything that decoded as UTF-8 instead of just ASCII as I think the mapping from UTF-8 to Unicode code points is an isomorphism, but I kept the ASCII behavior as I'm really only trying to fix the greasing issue.

Note that there are a few changes not related to this fix caused by black formatting tls.py.

Copy link

codecov bot commented Feb 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (74e8479) 100.00% compared to head (4738aee) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #467   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           25        25           
  Lines         4884      4891    +7     
=========================================
+ Hits          4884      4891    +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jlaine jlaine self-requested a review February 17, 2024 13:58
Copy link
Contributor

@jlaine jlaine left a comment

Choose a reason for hiding this comment

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

Looks good, I like the SkipItem exception!

@rthalley rthalley merged commit e726115 into aiortc:main Feb 17, 2024
29 checks passed
@rthalley rthalley deleted the alpn-decode branch February 17, 2024 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants