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

close on invalid UTF-8 #35

Merged
merged 3 commits into from
Apr 16, 2018
Merged

close on invalid UTF-8 #35

merged 3 commits into from
Apr 16, 2018

Conversation

Andrew-Lees11
Copy link
Contributor

This pull request makes the websocket server close the connection on receiving invalid UTF-8 and return the error message:
Failed to convert received payload to UTF-8 String

A new test has been added which sends invalid utf-8 and expects to receive this error code.

part = self.payload(text: "Failed to convert received payload to UTF-8 String")
expectedPayload.append(part.bytes, length: part.length)

self.performTest(framesToSend: [(true, self.opcodeText, textPayload as NSData)],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work on Linux because there's no bridging.

@codecov-io
Copy link

Codecov Report

Merging #35 into master will increase coverage by 0.6%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master      #35     +/-   ##
=========================================
+ Coverage   91.51%   92.12%   +0.6%     
=========================================
  Files           9        9             
  Lines         495      495             
=========================================
+ Hits          453      456      +3     
+ Misses         42       39      -3
Flag Coverage Δ
#KituraWebSocket 92.12% <100%> (+0.6%) ⬆️
Impacted Files Coverage Δ
Sources/KituraWebSocket/WebSocketConnection.swift 92.74% <100%> (+1.03%) ⬆️
...ces/KituraWebSocket/WebSocketCloseReasonCode.swift 41.37% <0%> (+3.44%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d3a6625...5da0536. Read the comment docs.

@Andrew-Lees11 Andrew-Lees11 merged commit 5a8b470 into master Apr 16, 2018
@Andrew-Lees11 Andrew-Lees11 deleted the invalidUTF branch April 16, 2018 07:49
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