mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-11-22 15:14:35 +00:00
fix(openai): strip residual input namespaces before HTTP forwarding
This commit is contained in:
1 parent
cb24522dd5
commit
e70fbf3204
6 files changed
+157
-2
No files matched your search
@@ -71,6 +71,14 @@ func (s *OpenAIGatewayService) Forward(ctx context.Context, c *gin.Context, acco
|
||||
}})
|
||||
return nil, err
|
||||
}
|
||||
body, err = stripOpenAIResponsesInputNamespaces(body)
|
||||
if err != nil {
|
||||
setOpsUpstreamError(c, http.StatusBadRequest, err.Error(), "")
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": gin.H{
|
||||
"type": "invalid_request_error", "message": err.Error(), "param": "input",
|
||||
}})
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
originalBody := body
|
||||
|
||||
Reference in new issue
Block a user