Skip to content

Commit fc1612e

Browse files
committed
Simplify IsStreamingEndpoint function by removing redundant checks and directly returning the result from StreamingEndpoints.
1 parent f13d29d commit fc1612e

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

api/endpoints.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,5 @@ func IsStreamingEndpoint(endpoint string) bool {
2828

2929
normalizedEndpoint := strings.TrimSuffix(path, "/")
3030

31-
if StreamingEndpoints[normalizedEndpoint] {
32-
return true
33-
}
34-
35-
for streamingEndpoint := range StreamingEndpoints {
36-
if strings.HasPrefix(normalizedEndpoint, streamingEndpoint) {
37-
return true
38-
}
39-
}
40-
41-
return false
31+
return StreamingEndpoints[normalizedEndpoint]
4232
}

0 commit comments

Comments
 (0)