MCPcopy Index your code
hub / github.com/FunctionStream/function-stream / selectHeaderAccept

Function selectHeaderAccept

admin/client/client.go:106–116  ·  view source on GitHub ↗

selectHeaderAccept join all accept types and return

(accepts []string)

Source from the content-addressed store, hash-verified

104
105// selectHeaderAccept join all accept types and return
106func selectHeaderAccept(accepts []string) string {
107 if len(accepts) == 0 {
108 return ""
109 }
110
111 if contains(accepts, "application/json") {
112 return "application/json"
113 }
114
115 return strings.Join(accepts, ",")
116}
117
118// contains is a case insensitive match, finding needle in a haystack
119func contains(haystack []string, needle string) bool {

Callers 11

ConsumeMessageExecuteMethod · 0.85
ProduceMessageExecuteMethod · 0.85
GetStatusExecuteMethod · 0.85
GetStateExecuteMethod · 0.85
SetStateExecuteMethod · 0.85
CreateFunctionExecuteMethod · 0.85
DeleteFunctionExecuteMethod · 0.85

Calls 1

containsFunction · 0.85

Tested by

no test coverage detected