Created
February 22, 2021 02:10
-
-
Save vkeenan/461801396a41f75fbcf87a1a84217a8f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package geo | |
import ( | |
"github.com/go-openapi/runtime/middleware" | |
"taxnexus.io/geo/restapi/operations/cors" | |
) | |
const headers = "Content-Type,X-API-Key" | |
const methods = "GET,POST,PUT,OPTIONS" | |
const origin = "*" | |
// CorsOptionsCoordinatesHandler is a CORS handler function | |
func CorsOptionsCoordinatesHandler(params cors.GetCoordinatesOptionsParams) middleware.Responder { | |
sugar.Info("geo.CorsOptionsCoordinatesHandler: | |
CORS OPTIONS inquiry") | |
return cors.NewGetCoordinatesOptionsOK(). | |
WithAccessControlAllowHeaders(headers). | |
WithAccessControlAllowMethods(methods). | |
WithAccessControlAllowOrigin(origin). | |
WithAccessControlMaxAge(corsTime) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment