Skip to content

close on invalid UTF-8#35

Merged
Andrew-Lees11 merged 3 commits intomasterfrom
invalidUTF
Apr 16, 2018
Merged

close on invalid UTF-8#35
Andrew-Lees11 merged 3 commits intomasterfrom
invalidUTF

Conversation

@Andrew-Lees11
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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