Skip to content

Commit

Permalink
Merge pull request #1241 from scorealarm/bugfix/adds-missing-characte…
Browse files Browse the repository at this point in the history
…r-for-url-encoding

Adds missing character for url encoding
  • Loading branch information
nuclearace authored Oct 17, 2019
2 parents 5dcfe18 + 5611c8a commit 1a0f6bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Source/SocketIO/Util/SocketExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extension Array {

extension CharacterSet {
static var allowedURLCharacterSet: CharacterSet {
return CharacterSet(charactersIn: "!*'();:@&=+$,/?%#[]\" {}^").inverted
return CharacterSet(charactersIn: "!*'();:@&=+$,/?%#[]\" {}^|").inverted
}
}

Expand Down
6 changes: 3 additions & 3 deletions Tests/TestSocketIO/SocketEngineTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ class SocketEngineTest: XCTestCase {
XCTAssertEqual(engine.urlWebSocket.query, "transport=websocket&created=2016-05-04T18%3A31%3A15%2B0200")

engine.connectParams = [
"forbidden": "!*'();:@&=+$,/?%#[]\" {}^"
"forbidden": "!*'();:@&=+$,/?%#[]\" {}^|"
]

XCTAssertEqual(engine.urlPolling.query, "transport=polling&b64=1&forbidden=%21%2A%27%28%29%3B%3A%40%26%3D%2B%24%2C%2F%3F%25%23%5B%5D%22%20%7B%7D%5E")
XCTAssertEqual(engine.urlWebSocket.query, "transport=websocket&forbidden=%21%2A%27%28%29%3B%3A%40%26%3D%2B%24%2C%2F%3F%25%23%5B%5D%22%20%7B%7D%5E")
XCTAssertEqual(engine.urlPolling.query, "transport=polling&b64=1&forbidden=%21%2A%27%28%29%3B%3A%40%26%3D%2B%24%2C%2F%3F%25%23%5B%5D%22%20%7B%7D%5E%7C")
XCTAssertEqual(engine.urlWebSocket.query, "transport=websocket&forbidden=%21%2A%27%28%29%3B%3A%40%26%3D%2B%24%2C%2F%3F%25%23%5B%5D%22%20%7B%7D%5E%7C")
}

func testBase64Data() {
Expand Down

0 comments on commit 1a0f6bb

Please sign in to comment.