Sean-Walker0 opened a new pull request, #7219:
URL: https://github.com/apache/shenyu/pull/7219

   <!-- Describe your PR here; e.g. Fixes #issueNo -->
   Fixes #6556
   
   `DefaultShenyuContextBuilder#buildData` detected the websocket rpc type with 
a case-sensitive `equals` against the lowercase literal `websocket`. RFC 6455 
(\u00a74.2.1, token semantics) requires the `Upgrade` header value to be 
compared **case-insensitively**, so a standards-compliant client sending 
`Upgrade: WebSocket` or `Upgrade: WEBSOCKET` fell through to the `http` rpc 
type and `WebSocketPlugin` skipped the upgrade handshake.
   
   <!--
   Thank you for proposing a pull request. This template will guide you through 
the essential steps necessary for a pull request.
   -->
   Make sure that:
   
   - [x] You have read the [contribution 
guidelines](https://shenyu.apache.org/community/contributor-guide).
   - [x] You submit test cases (unit or integration tests) that back your 
changes.
   - [x] Your local test passed `./mvnw test -pl 
shenyu-plugin/shenyu-plugin-global -am` and `./mvnw checkstyle:check -pl 
shenyu-plugin/shenyu-plugin-global` (module-scoped; full build left to CI).
   
   ### Modifications
   
   - `DefaultShenyuContextBuilder#buildData`: compare the `Upgrade` header 
value with `equalsIgnoreCase` instead of `equals`.
   
   ### Verifying this change
   
   - New unit tests in `DefaultShenyuContextBuilderTest`:
     - `websocket` / `WebSocket` / `WEBSOCKET` / `Websocket` header values all 
resolve to the websocket rpc type (the previous code failed the three 
non-lowercase variants);
     - an unrelated `Upgrade: h2c` value still resolves to the http rpc type.
   - `shenyu-plugin-global`: 9/9 tests passed, checkstyle passed.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to