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

Fix HTTP/2 feature check #1120

Merged
merged 1 commit into from
Jan 20, 2023
Merged

Fix HTTP/2 feature check #1120

merged 1 commit into from
Jan 20, 2023

Conversation

Ndiritu
Copy link
Contributor

@Ndiritu Ndiritu commented Jan 19, 2023

related to #854

Before enabling HTTP/2, we check if the feature is supported by curl. curl_version()["features"] provides a bitmask comprised of the supported features.

We perform a bitwise & with the CURL_VERSION_HTTP2 flag to check if it's enabled.

Previous implementation had 2 bugs:

  • We should be comparing the result of the bitwise operation with the CURL_VERSION_HTTP2 flag
  • Without parentheses, curl_version()["features"] & CURL_VERSION_HTTP2 !== 0 first evaluates CURL_VERSION_HTTP2 !== 0 then performs the bitwise & always returning 1 hence HTTP/2 would always be enabled even if the curl library doesn't enable it.

This PR fixes this.

Microsoft Reviewers: Open in CodeFlow

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.

3 participants