From fc1cbb2457db31e5921240aae3ca1ed91103854f Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 19 Dec 2024 15:16:08 +0800 Subject: [PATCH] Add OPTIONS routes for new generation endpoints in Neo API - Registered new OPTIONS routes for /generate, /generate/title, and /generate/prompts in the Neo API, enhancing CORS support for the recently introduced generation functionalities. - This update ensures that the API can handle preflight requests for these endpoints, improving overall API usability and compliance with CORS standards. --- neo/api.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/neo/api.go b/neo/api.go index 8f692db6..9d35b0c0 100644 --- a/neo/api.go +++ b/neo/api.go @@ -36,6 +36,9 @@ func (neo *DSL) API(router *gin.Engine, path string) error { router.OPTIONS(path+"/upload", neo.optionsHandler) router.OPTIONS(path+"/download", neo.optionsHandler) router.OPTIONS(path+"/mentions", neo.optionsHandler) + router.OPTIONS(path+"/generate", neo.optionsHandler) + router.OPTIONS(path+"/generate/title", neo.optionsHandler) + router.OPTIONS(path+"/generate/prompts", neo.optionsHandler) router.OPTIONS(path+"/dangerous/clear_chats", neo.optionsHandler) // Register endpoints with middlewares