AlinsRan commented on code in PR #12584:
URL: https://github.com/apache/apisix/pull/12584#discussion_r2321554898
##########
apisix/plugins/ai-proxy-multi.lua:
##########
@@ -170,14 +170,24 @@ end
local function resolve_endpoint(instance_conf)
+ local scheme, host, port
local endpoint = core.table.try_read_attr(instance_conf, "override",
"endpoint")
- local scheme, host, port, _ = endpoint:match(endpoint_regex)
- if port == "" then
- port = (scheme == "https") and "443" or "80"
+ if endpoint then
+ scheme, host, port = endpoint:match("^(https?)://([^:/]+):?(%d*)/?.*$")
Review Comment:
Why not use this constant `endpoint_regex`.
https://github.com/apache/apisix/blob/38ea6f81d53c0cf601edb4463b8d3001c9b0df9e/apisix/plugins/ai-proxy-multi.lua#L33
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]