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/08 10:48:46 UTC

[GitHub] [apisix-dashboard] 840963657 opened a new issue #2368: health check has an error message

840963657 opened a new issue #2368:
URL: https://github.com/apache/apisix-dashboard/issues/2368


   ### Issue description
   
   1、add new route;
   2、enable health check and add a header parameter;
   3、modify route and remove the header parameter;
   4、when i submit , there is an error message displayed in the browser
   
   ### Expected behavior
   
   add route success
   
   ### How to Reproduce
   
   1、add new route;
   2、enable health check;
   3、add a header parameter ;
   4、submit;
   5、modify this route;
   6、remove the header parameter;
   7、submit;
   
   ### Screenshots
   
   ![image](https://user-images.githubusercontent.com/25243232/157217727-eaf4d8be-96ec-4911-81c5-ad01c4ad8ec3.png)
   ![image](https://user-images.githubusercontent.com/25243232/157217887-4c652cb7-d398-4527-8895-5d5b92a4c5ea.png)
   ![image](https://user-images.githubusercontent.com/25243232/157218022-ee426f3c-763e-40cc-906a-8b46facfa336.png)
   
   
   ### Environment
   
   - apisix version (cmd: `apisix version`):2.11.0
   - OS (cmd: `uname -a`):linux
   - OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`):openresty/1.19.9.1
   - etcd version, if have (cmd: run `etcd --version`):etcd Version: 3.4.13
   - apisix-dashboard version, if have:2.11.0
   - Browser version, if have: chrome(97.0.4692.71)
   
   
   ### Additional context
   
   I checked the apisix code. req_headers is an array, if req_headers not nil ,then there is at least one value in req_headers.
   So I think apisix-dashboard pass apisix an empty array,like this: req_headers[]。
   Then apisix validate failed,error message is: Array must have at least 1 items


-- 
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-dashboard] 840963657 commented on issue #2368: health check has an error message

Posted by GitBox <gi...@apache.org>.
840963657 commented on issue #2368:
URL: https://github.com/apache/apisix-dashboard/issues/2368#issuecomment-1062654070


   > Hi @840963657, thanks for your report. After examination, there is indeed this problem. Would you like to help fix this problem?
   > 
   > ### The reason
   > The request headers in the health check are empty by default, and in this case, there is no `req_headers` field in the request data sent by the web to the API. However, when the user makes changes in this field, especially by removing all request headers, the data sent to the API contains the `req_headers` field and the value is an empty array, which causes an error.
   > 
   > ### Possible solutions
   > The UI form ensures that requests sent to the API always do not contain the `req_headers` field, regardless of whether the initial value of the request header is empty or the user removes all the request headers. And send the correct array of data to the API after the user has entered the request headers
   
   I‘m sorry,I'm not familiar with JS...’


-- 
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-dashboard] guoqqqi commented on issue #2368: health check has an error message

Posted by GitBox <gi...@apache.org>.
guoqqqi commented on issue #2368:
URL: https://github.com/apache/apisix-dashboard/issues/2368#issuecomment-1065839176


   > The UI form ensures that requests sent to the API always do not contain the `req_headers` field, regardless of whether the initial value of the request header is empty or the user removes all the request headers. And send the correct array of data to the API after the user has entered the request headers
   
   @Si-ege Do you have time to help solve this problem? 


-- 
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-dashboard] Si-ege commented on issue #2368: health check has an error message

Posted by GitBox <gi...@apache.org>.
Si-ege commented on issue #2368:
URL: https://github.com/apache/apisix-dashboard/issues/2368#issuecomment-1065839580


   I can try to complete the question


-- 
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-dashboard] Baoyuantop commented on issue #2368: health check has an error message

Posted by GitBox <gi...@apache.org>.
Baoyuantop commented on issue #2368:
URL: https://github.com/apache/apisix-dashboard/issues/2368#issuecomment-1062515503


   Hi @840963657, thanks for your report. After examination, there is indeed this problem. Would you like to help fix this problem?
   
   ### The reason
   The request headers in the health check are empty by default, and in this case, there is no `req_headers` field in the request data sent by the web to the API. However, when the user makes changes in this field, especially by removing all request headers, the data sent to the API contains the `req_headers` field and the value is an empty array, which causes an error.
   
   ### Possible solutions
   The UI form ensures that requests sent to the API always do not contain the `req_headers` field, regardless of whether the initial value of the request header is empty or the user removes all the request headers. And send the correct array of data to the API after the user has entered the request headers


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