func (c CORSMiddleware) WrapHandler(handler func(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error) func(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
    return func(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
        // If "api-cors-header" is not given, but "api-enable-cors" is true, we set cors to "*"
        // otherwise, all head values will be passed to HTTP handler
        corsHeaders := c.defaultHeaders