feat: publish sanitized custom.97 source

This commit is contained in:
cneicy committed 2026-10-27 20:43:39 +08:00
1 parent 8e6ed0317b
commit 86c0276156
1022 files changed
+69903 -19207

No files matched your search

+11 -2
View File
@@ -1,7 +1,7 @@
package middleware
import (
"fmt"
"net/http"
"github.com/QuantumNous/new-api/common"
"github.com/QuantumNous/new-api/dto"
@@ -32,7 +32,16 @@ func abortWithOpenAiMessage(c *gin.Context, statusCode int, message string, code
})
}
c.Abort()
logger.LogError(c.Request.Context(), fmt.Sprintf("user %d | %s", userId, message))
logger.LogError(c.Request.Context(), common.LogText("user %d | %s", userId, message))
}
// invalidRequestStatus is the status of a request whose body could not be
// read or parsed: 413 when the body exceeds MAX_REQUEST_BODY_MB, else 400.
func invalidRequestStatus(err error) int {
if common.IsRequestBodyTooLargeError(err) {
return http.StatusRequestEntityTooLarge
}
return http.StatusBadRequest
}
func abortWithMidjourneyMessage(c *gin.Context, statusCode int, code int, description string) {