refactor: Sanitize log inputs to prevent injection attacks
This commit is contained in:
@@ -82,10 +82,10 @@ func (r *OpenAIReranker) Rerank(ctx context.Context, query string, documents []s
|
||||
req.Header.Set("Content-Type", "application/json")
|
||||
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", r.apiKey))
|
||||
|
||||
// Log the curl equivalent for debugging
|
||||
// Log the curl equivalent for debugging (API key masked for security)
|
||||
logger.GetLogger(ctx).Infof(
|
||||
"curl -X POST %s/rerank -H \"Content-Type: application/json\" -H \"Authorization: Bearer %s\" -d '%s'",
|
||||
r.baseURL, r.apiKey, string(jsonData),
|
||||
"curl -X POST %s/rerank -H \"Content-Type: application/json\" -H \"Authorization: Bearer ***\" -d '%s'",
|
||||
r.baseURL, string(jsonData),
|
||||
)
|
||||
|
||||
resp, err := r.client.Do(req)
|
||||
|
||||
Reference in New Issue
Block a user