liuxiran commented on issue #2924:
URL: https://github.com/apache/apisix/issues/2924#issuecomment-737906076


   >remote_addrs: [] and remote_addrs: nil are two different things in the 
backend code. The former one means: I want to match the remote_addrs, but the 
given addresses are empty. The latter one means: I don't want to match 
remote_addrs.
   Even there is not problem today, we will be bitten in the future if we don't 
take care about the type (Like the integer id 1 VS string id "1", and many 
other cases happened in my career).
   
   Thanks for @spacewander's instructions, it gives me more insight into the 
function.
   > 1. means never match
   > 2. means always match
   
   Without any explanations I will vote to 1,  never match.
   
   BTW, Let me explain why there is an empty array here.
   
   - to configure data, FE usually choose **form** as a way to interact with 
users. 
   
   - we will all the configuration items so that user can config all items they 
want.
   
   - for the **optional items**, use can not fill any thing, that means user do 
not customize this item,  for these unconfigured options,  it **will be an 
empty Array, or empty Object**.
   
   Therefore, the data on the FE is loyal to the interaction needs by default, 
while the underlying data(APISIX) is loyal to the technology itself. It's 
normal to have differences.
   
   > maybe as the bridge between frontend and data source, the manager-api 
would be more reasonable to take this responsibility IMO
   
   As @juzhiyuan said, when we need to convert data, manager-api would be more 
reasonable to take this responsibility. This allows the FE to focus on UE and 
APISIX to focus on function.
   
   Premisely, we have to reach an agreement on how to guide the user to operate.
   
   
   
   


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to