ci/cd: migrate backend linter to v2. fixed unit test workflow (#400)

This commit is contained in:
Rich
2025-03-28 02:00:55 -07:00
committed by GitHub
parent cbd1bbdf74
commit b935a4824a
16 changed files with 95 additions and 53 deletions

View File

@@ -1,6 +1,8 @@
package middleware
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/pocket-id/pocket-id/backend/internal/common"
)
@@ -23,7 +25,7 @@ func (m *CorsMiddleware) Add() gin.HandlerFunc {
c.Writer.Header().Set("Access-Control-Allow-Headers", "*")
c.Writer.Header().Set("Access-Control-Allow-Methods", "POST, OPTIONS, GET, PUT")
if c.Request.Method == "OPTIONS" {
if c.Request.Method == http.MethodOptions {
c.AbortWithStatus(204)
return
}