Skip to content

Commit b3304bb

Browse files
committed
feat(connector)_: inject connection type only to a websocket connection
* set clientId in ConnectorClient fixes #6972
1 parent efa6778 commit b3304bb

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

services/connector/context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func GetConnectionType(ctx context.Context) ConnectionType {
3131
if connType, ok := ctx.Value(connectionTypeKey).(ConnectionType); ok {
3232
return connType
3333
}
34-
return ConnectionTypeHTTP // default to untrusted
34+
return ConnectionTypeInternal // default to untrusted
3535
}
3636

3737
// IsUntrustedConnection checks if the connection is from HTTP/WebSocket

services/connector/context_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ func TestConnectionTypeDefault(t *testing.T) {
2121
// Context without connection type should default to untrusted
2222
ctx := context.Background()
2323

24-
if !IsUntrustedConnection(ctx) {
24+
if IsUntrustedConnection(ctx) {
2525
t.Error("Default connection type should be untrusted (HTTP)")
2626
}
2727

28-
if got := GetConnectionType(ctx); got != ConnectionTypeHTTP {
29-
t.Errorf("Default GetConnectionType() = %v, want %v", got, ConnectionTypeHTTP)
28+
if got := GetConnectionType(ctx); got != ConnectionTypeInternal {
29+
t.Errorf("Default GetConnectionType() = %v, want %v", got, ConnectionTypeInternal)
3030
}
3131
}

tests-functional/clients/connector.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def _send(self, method, params=None):
9292
"name": self.name,
9393
"url": "http://localhost/",
9494
"method": method,
95+
"clientId": "tests-functional",
9596
}
9697
if params is not None:
9798
request["params"] = params

0 commit comments

Comments
 (0)