Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Sources/SparkConnect/SparkConnectClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public actor SparkConnectClient {
#endif
for param in self.url.path.split(separator: ";").dropFirst().filter({ !$0.isEmpty }) {
let kv = param.split(separator: "=")
switch String(kv[0]) {
switch String(kv[0]).lowercased() {
case URIParams.PARAM_USER_AGENT:
clientType = String(kv[1])
case URIParams.PARAM_TOKEN:
Expand Down Expand Up @@ -596,11 +596,11 @@ public actor SparkConnectClient {
}

private enum URIParams {
static let PARAM_USER_ID = "userId"
static let PARAM_USER_AGENT = "userAgent"
static let PARAM_GRPC_MAX_MESSAGE_SIZE = "grpc_max_message_size"
static let PARAM_SESSION_ID = "session_id"
static let PARAM_TOKEN = "token"
static let PARAM_USE_SSL = "useSsl"
static let PARAM_SESSION_ID = "sessionId"
static let PARAM_GRPC_MAX_MESSAGE_SIZE = "grpcMaxMessageSize"
static let PARAM_USER_AGENT = "user_agent"
static let PARAM_USER_ID = "user_id"
static let PARAM_USE_SSL = "use_ssl"
}
}
2 changes: 1 addition & 1 deletion Tests/SparkConnectTests/SparkConnectClientTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct SparkConnectClientTests {

@Test
func parameters() async throws {
let client = SparkConnectClient(remote: "sc://host1:123/;token=abcd;userId=test;userAgent=myagent")
let client = SparkConnectClient(remote: "sc://host1:123/;tOkeN=abcd;user_ID=test;USER_agent=myagent")
#expect(await client.token == "abcd")
#expect(await client.userContext.userID == "test")
#expect(await client.clientType == "myagent")
Expand Down
Loading