You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "zuiyangqingzhou (via GitHub)" <gi...@apache.org> on 2023/04/14 11:22:50 UTC

[GitHub] [apisix] zuiyangqingzhou opened a new pull request, #9311: perf: optimized redirect plugin

zuiyangqingzhou opened a new pull request, #9311:
URL: https://github.com/apache/apisix/pull/9311

   ### Description
   
   1.  Adjusted the check_schema function position
   2. Adjusted the use of the tmp variable in the concat_new_uri function
   
   
   ### Checklist
   
   - [ ] I have explained the need for this PR and the problem it solves
   - [ ] I have explained the changes or the new features added to this PR
   - [ ] I have added tests corresponding to this change
   - [ ] I have updated the documentation to reflect this change
   - [ ] I have verified that this change is backward compatible (If not, please discuss on the [APISIX mailing list](https://github.com/apache/apisix/tree/master#community) first)
   
   <!--
   
   Note
   
   1. Mark the PR as draft until it's ready to be reviewed.
   2. Always add/update tests for any changes unless you have a good reason.
   3. Always update the documentation to reflect the changes made in the PR.
   4. Make a new commit to resolve conversations instead of `push -f`.
   5. To resolve merge conflicts, merge master instead of rebasing.
   6. Use "request review" to notify the reviewer after making changes.
   7. Only a reviewer can mark a conversation as resolved.
   
   -->
   


-- 
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


[GitHub] [apisix] monkeyDluffy6017 closed pull request #9311: perf: optimized redirect plugin

Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 closed pull request #9311: perf: optimized redirect plugin
URL: https://github.com/apache/apisix/pull/9311


-- 
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


[GitHub] [apisix] monkeyDluffy6017 commented on pull request #9311: perf: optimized redirect plugin

Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 commented on PR #9311:
URL: https://github.com/apache/apisix/pull/9311#issuecomment-1537090427

   I will close this pr, feel free to reopen it


-- 
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


[GitHub] [apisix] monkeyDluffy6017 commented on a diff in pull request #9311: perf: optimized redirect plugin

Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 commented on code in PR #9311:
URL: https://github.com/apache/apisix/pull/9311#discussion_r1184696241


##########
apisix/plugins/redirect.lua:
##########
@@ -75,6 +75,31 @@ local _M = {
 }
 
 
+function _M.check_schema(conf)
+    local ok, err = core.schema.check(schema, conf)
+
+    if not ok then
+        return false, err
+    end
+
+    if conf.regex_uri and #conf.regex_uri > 0 then
+        local _, _, err = re_sub("/fake_uri", conf.regex_uri[1],
+                conf.regex_uri[2], "jo")
+        if err then
+            local msg = string_format("invalid regex_uri (%s, %s), err:%s",
+                    conf.regex_uri[1], conf.regex_uri[2], err)
+            return false, msg
+        end
+    end
+
+    if conf.http_to_https and conf.append_query_string then
+        return false, "only one of `http_to_https` and `append_query_string` can be configured."
+    end
+
+    return true
+end
+
+

Review Comment:
   I suggest not moving this function in this pr, it doesn't match the pr title



-- 
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


[GitHub] [apisix] monkeyDluffy6017 commented on pull request #9311: perf: optimized redirect plugin

Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 commented on PR #9311:
URL: https://github.com/apache/apisix/pull/9311#issuecomment-1534305403

   Hi @zuiyangqingzhou, I think this pr is unnecessary, using the `table.clear` function is to reuse the allocated memory, avoid duplicate memory allocation


-- 
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