Open adam-fowler opened 10 months ago
Thanks for filing this. I will take a look!
One of the reasons I was receiving inappropriateOperationForState
was the server wasn't returning a response to the WebSocket upgrade request, it was just closing the connection. If I return a response everything is ok.
I guess we still shouldn't be receiving a inappropriateOperationForState
error though even if the server closes the connection
Expected behavior
WebSocket client should call
notUpgradingCompletionHandler
fromNIOTypedHTTPClientUpgradeConfiguration
when WebSocket server refuses a connection.Actual behavior
WebSocket upgrade throws
inappropriateOperationForState
errorSteps to reproduce
This can be easily reproduced using the WebSocket samples that come with SwiftNIO
shouldUpgrade
closure ofNIOTypedWebSocketServerUpgrader
in NIOWebSocketServer/Server.swift line 82 to beSwiftNIO version/commit hash
Swift version 5.10-dev (LLVM e8e5be8d5b39f46, Swift 99e9db868aefd99) Target: x86_64-unknown-linux-gnu