mirror of
https://github.com/photoprism/photoprism.git
synced 2025-10-06 01:07:16 +08:00
21 lines
412 B
Go
21 lines
412 B
Go
package api
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
// Options returns an empty response to handle CORS preflight requests.
|
|
//
|
|
// @Summary returns CORS headers with an empty response body
|
|
// @Id Options
|
|
// @Tags Dev
|
|
// @Success 204
|
|
// @Router /api/v1/{any} [options]
|
|
func Options(router *gin.RouterGroup) {
|
|
router.OPTIONS("/*any", func(c *gin.Context) {
|
|
c.Status(http.StatusNoContent)
|
|
})
|
|
}
|