You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/03/10 05:42:37 UTC

[GitHub] [apisix] Gary-Airwallex commented on a change in pull request #6546: feat: set cors allow origins by plugin metadata

Gary-Airwallex commented on a change in pull request #6546:
URL: https://github.com/apache/apisix/pull/6546#discussion_r823365079



##########
File path: apisix/plugins/cors.lua
##########
@@ -177,13 +208,19 @@ local function set_cors_headers(conf, ctx)
     end
 end
 
-local function process_with_allow_origins(conf, ctx, req_origin)
-    local allow_origins = conf.allow_origins
+local function process_with_allow_origins(allow_origins_conf, ctx, req_origin,
+                                          cache_key, cache_version)
+    local allow_origins = allow_origins_conf
     if allow_origins == "**" then
         allow_origins = req_origin or '*'
     end
-    local multiple_origin, err = core.lrucache.plugin_ctx(lrucache, ctx, nil,
-                                                create_multiple_origin_cache, conf)
+
+    if not (cache_key and cache_version) then
+        cache_key, cache_version = core.lrucache.plugin_ctx_id(ctx)

Review comment:
       😂fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org