Skip to content

Commit

Permalink
Merge pull request #410 from qiuncheng/master
Browse files Browse the repository at this point in the history
Fixed #409 When url contains query, server cannot get query parameters.
  • Loading branch information
daltoniam authored Nov 6, 2017
2 parents a1f133d + e818219 commit ca20b02
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Sources/WebSocket.swift
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,9 @@ open class WebSocket : NSObject, StreamDelegate, WebSocketClient, WSStreamDelega
path = String(path[range.lowerBound..<path.endIndex])
} else {
path = "/"
if let query = url.query {
path += "?" + query
}
}

var httpBody = "\(request.httpMethod ?? "GET") \(path) HTTP/1.1\r\n"
Expand Down

0 comments on commit ca20b02

Please sign in to comment.