Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CORS ¶
CORS middleware handles Cross-Origin Resource Sharing Configurable via environment variables: - CORS_ALLOWED_ORIGINS: comma-separated list of allowed origins (supports wildcards like https://*.domain.com) - CORS_ALLOWED_METHODS: comma-separated list of allowed HTTP methods - CORS_ALLOWED_HEADERS: comma-separated list of allowed headers
Wildcard Support: The middleware supports wildcard patterns in origins using asterisk (*) as a wildcard character. Examples:
- https://*.example.com matches https://preview.example.com, https://staging.example.com, etc.
- https://preview-*.pages.dev matches https://preview-abc123.pages.dev, etc.
Note: Wildcards are converted to regex patterns for matching. Use with caution to avoid overly permissive CORS policies.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.