Skip to content

Update RequestConverter upgrade header handling. - #8766

Merged
AutomatedTester merged 1 commit into
SeleniumHQ:trunkfrom
pujagani:fix_upgrade_header_handling
Oct 9, 2020
Merged

Update RequestConverter upgrade header handling.#8766
AutomatedTester merged 1 commit into
SeleniumHQ:trunkfrom
pujagani:fix_upgrade_header_handling

Conversation

@pujagani

@pujagani pujagani commented Oct 9, 2020

Copy link
Copy Markdown
Contributor

Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it

Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.

Description

Updated header handling of upgrade and Sec-WebSocket-Version headers.

Motivation and Context

  1. Upon receiving the request it goes through a series of handlers.
  2. It goes through the WebSockethandler, https://github.com/SeleniumHQ/selenium/blob/selenium-4.0.0-alpha-6/java/server/src/org/openqa/selenium/netty/server/WebSocketUpgradeHandler.java#L103.
  3. To upgrade to using sockets both headers are required. All checks work without quotes only.
  4. When just upgrade or Sec-WebSocket-Version is sent, the request is passed along to . When quotes are used, the condition is always false and moved ahead to get a response.
  5. When quotes are not used, the check if actually done and uses logical OR, the request is passed along further but there is nothing to handle it and it just waits. AND fixes it because both headers are needed and if so it would be handled earlier in the pipeline.
  6. Using AND will move along and response to the request using SeleniumHandler.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@AutomatedTester

Copy link
Copy Markdown
Member

Tested this change on BS infra and it works

@AutomatedTester
AutomatedTester merged commit 5172043 into SeleniumHQ:trunk Oct 9, 2020
pujagani added a commit to pujagani/selenium that referenced this pull request Oct 12, 2020
k7z45 pushed a commit to k7z45/selenium that referenced this pull request Oct 20, 2020
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