cors

cors

import "github.com/yuta-yoshinaga/go_trumpcards/internal/infrastructure/cors"

Index

## func Middleware

func Middleware(allowedOrigins map[string]bool, next http.Handler) http.Handler

Middleware returns an http.Handler that applies CORS headers for the given set of allowed origins. Only POST requests with Content-Type are permitted. Preflight OPTIONS requests receive the appropriate headers and a 204 response.

## func ParseOrigins

func ParseOrigins(csv string) map[string]bool

ParseOrigins parses a comma-separated list of origins into a map.

Generated by gomarkdoc