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

Add additional close statuses in ManagedWebSocket #83827

Merged
merged 9 commits into from
Mar 31, 2023

Commits on Mar 30, 2023

  1. Allow non RFC close statuses in ManagedWebSocket

    Add ServiceRestart (1012), TryAgainLater (1013), and BadGateway (1014) to the list of `WebSocketCloseStatus` values and allow them to be used as valid WebSocket close statuses so we don't reject the close and discard the status description by adding them to the private `IsValueCloseStatus` method switch statement declaring them as valid `true`. 
    These codes are documented [here as IANA registered codes](https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent/code) as valid server-initiated close reasons.
    
    Fixes Issue dotnet#82602
    IDisposable committed Mar 30, 2023
    Configuration menu
    Copy the full SHA
    5081756 View commit details
    Browse the repository at this point in the history
  2. Cleanup comment format

    Co-authored-by: MartyIX <[email protected]>
    IDisposable and MartyIX committed Mar 30, 2023
    Configuration menu
    Copy the full SHA
    e06f810 View commit details
    Browse the repository at this point in the history
  3. Rename test data to CloseStatuses

    Co-authored-by: Natalia Kondratyeva <[email protected]>
    IDisposable and CarnaViire committed Mar 30, 2023
    Configuration menu
    Copy the full SHA
    76f873a View commit details
    Browse the repository at this point in the history
  4. Rename test method to follow naming convention.

    Co-authored-by: Natalia Kondratyeva <[email protected]>
    IDisposable and CarnaViire committed Mar 30, 2023
    Configuration menu
    Copy the full SHA
    4ae46f0 View commit details
    Browse the repository at this point in the history
  5. Addressed PR feedback

    Finished rename of CloseStatuses test data
    Renamed `closeStatusDescription` to `serverMessage`
    Send hello message and close status then await both responses and
    check they are as expected. This necessitated switching to the `ReceiveAsync` that accepts an `ArraySegment`.
    Explicitly typed `var`s
    Inlined helper methods (for clarity)
    IDisposable committed Mar 30, 2023
    Configuration menu
    Copy the full SHA
    8a2cc0a View commit details
    Browse the repository at this point in the history
  6. Rename local for per PR feedback

    Swapping back to a distinct and more appropriately named variable for the `closeStatusDescription`
    
    Co-authored-by: Natalia Kondratyeva <[email protected]>
    IDisposable and CarnaViire committed Mar 30, 2023
    Configuration menu
    Copy the full SHA
    e479a56 View commit details
    Browse the repository at this point in the history
  7. Label the boolean for isServer flag

    Co-authored-by: Natalia Kondratyeva <[email protected]>
    IDisposable and CarnaViire committed Mar 30, 2023
    Configuration menu
    Copy the full SHA
    9e15dec View commit details
    Browse the repository at this point in the history
  8. Use better local variable name

    Renamed local `serverMessage` back to `closeStatusDescription` per PR feedback.
    Co-authored-by: Natalia Kondratyeva <[email protected]>
    IDisposable committed Mar 30, 2023
    Configuration menu
    Copy the full SHA
    e349b33 View commit details
    Browse the repository at this point in the history
  9. Address PR and rebase to main

    Rebased to current main, updated the commit messages and added the remaining changes to address the PR comments.
    IDisposable committed Mar 30, 2023
    Configuration menu
    Copy the full SHA
    1633968 View commit details
    Browse the repository at this point in the history