From 328dd40ca4b186cee1d87dc625bbc31442075490 Mon Sep 17 00:00:00 2001 From: junwen-lee Date: Mon, 27 Oct 2025 11:01:33 +0800 Subject: [PATCH] fix: add header (#2392) --- backend/domain/plugin/service/tool/invocation_saas.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/domain/plugin/service/tool/invocation_saas.go b/backend/domain/plugin/service/tool/invocation_saas.go index c08ea8dce..2a2ac79ea 100644 --- a/backend/domain/plugin/service/tool/invocation_saas.go +++ b/backend/domain/plugin/service/tool/invocation_saas.go @@ -51,6 +51,8 @@ func (s *saasCallImpl) Do(ctx context.Context, args *InvocationArgs) (request st return "", "", err } + s.injectUserAgentHeader(ctx, httpReq) + var reqBodyBytes []byte if httpReq.GetBody != nil { reqBody, err := httpReq.GetBody() @@ -118,6 +120,9 @@ func (s *saasCallImpl) injectAuthInfo(ctx context.Context, httpReq *http.Request httpReq.Header.Set("Authorization", "Bearer "+saasapiClient.APIKey) return nil } +func (s *saasCallImpl) injectUserAgentHeader(ctx context.Context, httpReq *http.Request) { + httpReq.Header.Set("User-Agent", "open_coze/1.0.0") +} func (s *saasCallImpl) buildHTTPRequest(ctx context.Context, args *InvocationArgs) (httpReq *http.Request, err error) { tool := args.Tool