/
githubmirror
/
photoprism
Обзор
Документация
Войти
/
githubmirror
/
photoprism
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
internal/api/options.go
21 строка
661 B
Michael Mayer
API: Update swagger endpoint documentation #5133
28 авг 2025, 12:00
28 авг 2025, 12:00
8337eb2
Код
Авторство
О чём код?
package api import ( "net/http" "github.com/gin-gonic/gin" ) // Options returns CORS headers with an empty response body. // // @Summary returns CORS headers with an empty response body // @Description A preflight request is automatically issued by a browser and in normal cases, front-end developers don't need to craft such requests themselves. It appears when request is qualified as "to be preflighted" and omitted for simple requests. // @Id Options // @Tags CORS // @Success 204 // @Router /api/v1/{any} [options] func Options(router *gin.RouterGroup) { router.OPTIONS("/*any", func(c *gin.Context) { c.Status(http.StatusNoContent) }) }