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 2021/04/09 06:39:47 UTC

[GitHub] [apisix] Firstsawyou opened a new pull request #4016: docs(admin-api): increase the introduction of the use of cookies

Firstsawyou opened a new pull request #4016:
URL: https://github.com/apache/apisix/pull/4016


   ### What this PR does / why we need it:
   <!--- Why is this change required? What problem does it solve? -->
   <!--- If it fixes an open issue, please link to the issue here. -->
   
   ### Pre-submission checklist:
   
   * [x] Did you explain what problem does this PR solve? Or what new features have been added?
   * [ ] Have you added corresponding test cases?
   * [ ] Have you modified the corresponding document?
   * [ ] Is this PR backward compatible? **If it is not backward compatible, please discuss on the [mailing list](https://github.com/apache/apisix/tree/master#community) first**
   


-- 
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:
users@infra.apache.org



[GitHub] [apisix] tokers merged pull request #4016: docs(admin-api): increase the introduction of the use of cookies

Posted by GitBox <gi...@apache.org>.
tokers merged pull request #4016:
URL: https://github.com/apache/apisix/pull/4016


   


-- 
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:
users@infra.apache.org



[GitHub] [apisix] tokers commented on a change in pull request #4016: docs(admin-api): increase the introduction of the use of cookies

Posted by GitBox <gi...@apache.org>.
tokers commented on a change in pull request #4016:
URL: https://github.com/apache/apisix/pull/4016#discussion_r611145081



##########
File path: docs/en/latest/admin-api.md
##########
@@ -94,7 +94,10 @@ Note: When the `Admin API` is enabled, it will occupy the API prefixed with `/ap
 | create_time      | False                                    | Auxiliary   | epoch timestamp in second, will be created automatically if missing                                                                                                                                                                                                                                                                                                                                                                | 1602883670                                           |
 | update_time      | False                                    | Auxiliary   | epoch timestamp in second, will be created automatically if missing                                                                                                                                                                                                                                                                                                                                                                | 1602883670                                           |
 
-For the same type of parameters, such as `host` and `hosts`, `remote_addr` and `remote_addrs` cannot exist at the same time, only one of them can be selected. If enabled at the same time, the API will respond with an error.
+There are two points that need special attention:
+
+- For the same type of parameters, such as `host` and `hosts`, `remote_addr` and `remote_addrs` cannot exist at the same time, only one of them can be selected. If enabled at the same time, the API will respond with an error.
+- In `vars`, when getting the cookie value, the cookie name is case-sensitive. For example: `var` equals "cookie_x_foo" and `var` equals "cookie_X_Foo" means different `cookie`.

Review comment:
       ```suggestion
   - In `vars`, when getting the cookie value, the cookie name is **case-sensitive**. For example: `var` equals "cookie_x_foo" and `var` equals "cookie_X_Foo" means different `cookie`.
   ```

##########
File path: docs/zh/latest/admin-api.md
##########
@@ -558,7 +558,7 @@ APISIX 的 Upstream 除了基本的复杂均衡算法选择外,还支持对上
 
 1. 设为 `vars` 时,`key` 为必传参数,目前支持的 Nginx 内置变量有 `uri, server_name, server_addr, request_uri, remote_port, remote_addr, query_string, host, hostname, arg_***`,其中 `arg_***` 是来自 URL 的请求参数,[Nginx 变量列表](http://nginx.org/en/docs/varindex.html)
 2. 设为 `header` 时, `key` 为必传参数,其值为自定义的 header name, 即 "http\_`key`"
-3. 设为 `cookie` 时, `key` 为必传参数,其值为自定义的 cookie name,即 "cookie\_`key`"
+3. 设为 `cookie` 时, `key` 为必传参数,其值为自定义的 cookie name,即 "cookie\_`key`"。请注意 cookie name 是区分大小写字母的。例如:"cookie_x_foo" 与 "cookie_X_Foo" 表示不同的 `cookie`。

Review comment:
       ```suggestion
   3. 设为 `cookie` 时, `key` 为必传参数,其值为自定义的 cookie name,即 "cookie\_`key`"。请注意 cookie name 是**区分大小写字母**的。例如:"cookie_x_foo" 与 "cookie_X_Foo" 表示不同的 `cookie`。
   ```




-- 
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:
users@infra.apache.org



[GitHub] [apisix] Firstsawyou commented on a change in pull request #4016: docs(admin-api): increase the introduction of the use of cookies

Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on a change in pull request #4016:
URL: https://github.com/apache/apisix/pull/4016#discussion_r610963014



##########
File path: docs/en/latest/admin-api.md
##########
@@ -555,7 +559,7 @@ In addition to the basic complex equalization algorithm selection, APISIX's Upst
 
 1. when it is `vars`, the `key` is required. The `key` can be any [Nginx builtin variables](http://nginx.org/en/docs/varindex.html), without the prefix '$'.
 1. when it is `header`, the `key` is required. It is equal to "http_`key`".
-1. when it is `cookie`, the `key` is required. It is equal to "cookie_`key`".
+1. when it is `cookie`, the `key` is required. It is equal to "cookie_`key`". Note: The cookie name is case-sensitive. For example: "cookie\_`x_foo`" and "cookie\_`X_Foo`" means to get different `cookie`.

Review comment:
       Updated.

##########
File path: docs/en/latest/admin-api.md
##########
@@ -94,7 +94,11 @@ Note: When the `Admin API` is enabled, it will occupy the API prefixed with `/ap
 | create_time      | False                                    | Auxiliary   | epoch timestamp in second, will be created automatically if missing                                                                                                                                                                                                                                                                                                                                                                | 1602883670                                           |
 | update_time      | False                                    | Auxiliary   | epoch timestamp in second, will be created automatically if missing                                                                                                                                                                                                                                                                                                                                                                | 1602883670                                           |
 
-For the same type of parameters, such as `host` and `hosts`, `remote_addr` and `remote_addrs` cannot exist at the same time, only one of them can be selected. If enabled at the same time, the API will respond with an error.
+There are three points that need special attention:
+
+- In addition to the required `uri`/`uris`, you must select at least one of the four categories `plugin`, `script`, `upstream`/`upstream_id` and `service_id`.

Review comment:
       Thanks for reminding, it has been updated.

##########
File path: docs/en/latest/admin-api.md
##########
@@ -94,7 +94,11 @@ Note: When the `Admin API` is enabled, it will occupy the API prefixed with `/ap
 | create_time      | False                                    | Auxiliary   | epoch timestamp in second, will be created automatically if missing                                                                                                                                                                                                                                                                                                                                                                | 1602883670                                           |
 | update_time      | False                                    | Auxiliary   | epoch timestamp in second, will be created automatically if missing                                                                                                                                                                                                                                                                                                                                                                | 1602883670                                           |
 
-For the same type of parameters, such as `host` and `hosts`, `remote_addr` and `remote_addrs` cannot exist at the same time, only one of them can be selected. If enabled at the same time, the API will respond with an error.
+There are three points that need special attention:
+
+- In addition to the required `uri`/`uris`, you must select at least one of the four categories `plugin`, `script`, `upstream`/`upstream_id` and `service_id`.
+- For the same type of parameters, such as `host` and `hosts`, `remote_addr` and `remote_addrs` cannot exist at the same time, only one of them can be selected. If enabled at the same time, the API will respond with an error.
+- When using `vars`, obtaining the value of `cookie` is case-sensitive. For example: `var` is "cookie\_`x_foo`" and `var` is "cookie\_`X_Foo`" means to get different `cookie`.

Review comment:
       Updated.




-- 
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:
users@infra.apache.org



[GitHub] [apisix] tokers commented on a change in pull request #4016: docs(admin-api): increase the introduction of the use of cookies

Posted by GitBox <gi...@apache.org>.
tokers commented on a change in pull request #4016:
URL: https://github.com/apache/apisix/pull/4016#discussion_r610994716



##########
File path: docs/en/latest/admin-api.md
##########
@@ -94,11 +94,10 @@ Note: When the `Admin API` is enabled, it will occupy the API prefixed with `/ap
 | create_time      | False                                    | Auxiliary   | epoch timestamp in second, will be created automatically if missing                                                                                                                                                                                                                                                                                                                                                                | 1602883670                                           |
 | update_time      | False                                    | Auxiliary   | epoch timestamp in second, will be created automatically if missing                                                                                                                                                                                                                                                                                                                                                                | 1602883670                                           |
 
-There are three points that need special attention:
+There are two points that need special attention:
 
-- In addition to the required `uri`/`uris`, you must select at least one of the four categories `plugin`, `script`, `upstream`/`upstream_id` and `service_id`.
 - For the same type of parameters, such as `host` and `hosts`, `remote_addr` and `remote_addrs` cannot exist at the same time, only one of them can be selected. If enabled at the same time, the API will respond with an error.
-- When using `vars`, obtaining the value of `cookie` is case-sensitive. For example: `var` is "cookie\_`x_foo`" and `var` is "cookie\_`X_Foo`" means to get different `cookie`.
+- In `vars`, when getting the cookie value, the cookie name is distinguished by uppercase and lowercase letters. For example: `var` equals "cookie_x_foo" and `var` equals "cookie_X_Foo" means different `cookie`.

Review comment:
       > the cookie name is distinguished by uppercase and lowercase letters
   
   We have a better term: "case-sensitive".




-- 
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:
users@infra.apache.org



[GitHub] [apisix] Firstsawyou commented on a change in pull request #4016: docs(admin-api): increase the introduction of the use of cookies

Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on a change in pull request #4016:
URL: https://github.com/apache/apisix/pull/4016#discussion_r611032802



##########
File path: docs/en/latest/admin-api.md
##########
@@ -94,11 +94,10 @@ Note: When the `Admin API` is enabled, it will occupy the API prefixed with `/ap
 | create_time      | False                                    | Auxiliary   | epoch timestamp in second, will be created automatically if missing                                                                                                                                                                                                                                                                                                                                                                | 1602883670                                           |
 | update_time      | False                                    | Auxiliary   | epoch timestamp in second, will be created automatically if missing                                                                                                                                                                                                                                                                                                                                                                | 1602883670                                           |
 
-There are three points that need special attention:
+There are two points that need special attention:
 
-- In addition to the required `uri`/`uris`, you must select at least one of the four categories `plugin`, `script`, `upstream`/`upstream_id` and `service_id`.
 - For the same type of parameters, such as `host` and `hosts`, `remote_addr` and `remote_addrs` cannot exist at the same time, only one of them can be selected. If enabled at the same time, the API will respond with an error.
-- When using `vars`, obtaining the value of `cookie` is case-sensitive. For example: `var` is "cookie\_`x_foo`" and `var` is "cookie\_`X_Foo`" means to get different `cookie`.
+- In `vars`, when getting the cookie value, the cookie name is distinguished by uppercase and lowercase letters. For example: `var` equals "cookie_x_foo" and `var` equals "cookie_X_Foo" means different `cookie`.

Review comment:
       Updated.




-- 
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:
users@infra.apache.org



[GitHub] [apisix] Firstsawyou commented on a change in pull request #4016: docs(admin-api): increase the introduction of the use of cookies

Posted by GitBox <gi...@apache.org>.
Firstsawyou commented on a change in pull request #4016:
URL: https://github.com/apache/apisix/pull/4016#discussion_r611205339



##########
File path: docs/en/latest/admin-api.md
##########
@@ -94,7 +94,10 @@ Note: When the `Admin API` is enabled, it will occupy the API prefixed with `/ap
 | create_time      | False                                    | Auxiliary   | epoch timestamp in second, will be created automatically if missing                                                                                                                                                                                                                                                                                                                                                                | 1602883670                                           |
 | update_time      | False                                    | Auxiliary   | epoch timestamp in second, will be created automatically if missing                                                                                                                                                                                                                                                                                                                                                                | 1602883670                                           |
 
-For the same type of parameters, such as `host` and `hosts`, `remote_addr` and `remote_addrs` cannot exist at the same time, only one of them can be selected. If enabled at the same time, the API will respond with an error.
+There are two points that need special attention:
+
+- For the same type of parameters, such as `host` and `hosts`, `remote_addr` and `remote_addrs` cannot exist at the same time, only one of them can be selected. If enabled at the same time, the API will respond with an error.
+- In `vars`, when getting the cookie value, the cookie name is case-sensitive. For example: `var` equals "cookie_x_foo" and `var` equals "cookie_X_Foo" means different `cookie`.

Review comment:
       Updated.

##########
File path: docs/zh/latest/admin-api.md
##########
@@ -558,7 +558,7 @@ APISIX 的 Upstream 除了基本的复杂均衡算法选择外,还支持对上
 
 1. 设为 `vars` 时,`key` 为必传参数,目前支持的 Nginx 内置变量有 `uri, server_name, server_addr, request_uri, remote_port, remote_addr, query_string, host, hostname, arg_***`,其中 `arg_***` 是来自 URL 的请求参数,[Nginx 变量列表](http://nginx.org/en/docs/varindex.html)
 2. 设为 `header` 时, `key` 为必传参数,其值为自定义的 header name, 即 "http\_`key`"
-3. 设为 `cookie` 时, `key` 为必传参数,其值为自定义的 cookie name,即 "cookie\_`key`"
+3. 设为 `cookie` 时, `key` 为必传参数,其值为自定义的 cookie name,即 "cookie\_`key`"。请注意 cookie name 是区分大小写字母的。例如:"cookie_x_foo" 与 "cookie_X_Foo" 表示不同的 `cookie`。

Review comment:
       Updated.




-- 
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:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on a change in pull request #4016: docs(admin-api): increase the introduction of the use of cookies

Posted by GitBox <gi...@apache.org>.
spacewander commented on a change in pull request #4016:
URL: https://github.com/apache/apisix/pull/4016#discussion_r610435434



##########
File path: docs/en/latest/admin-api.md
##########
@@ -555,7 +559,7 @@ In addition to the basic complex equalization algorithm selection, APISIX's Upst
 
 1. when it is `vars`, the `key` is required. The `key` can be any [Nginx builtin variables](http://nginx.org/en/docs/varindex.html), without the prefix '$'.
 1. when it is `header`, the `key` is required. It is equal to "http_`key`".
-1. when it is `cookie`, the `key` is required. It is equal to "cookie_`key`".
+1. when it is `cookie`, the `key` is required. It is equal to "cookie_`key`". Note: The cookie name is case-sensitive. For example: "cookie\_`x_foo`" and "cookie\_`X_Foo`" means to get different `cookie`.

Review comment:
       Please remove quotes in "cookie\_`x_foo`" and the other. And this sentence looks strange to me. I doubt it has a grammar problem but I am not sure.

##########
File path: docs/en/latest/admin-api.md
##########
@@ -94,7 +94,11 @@ Note: When the `Admin API` is enabled, it will occupy the API prefixed with `/ap
 | create_time      | False                                    | Auxiliary   | epoch timestamp in second, will be created automatically if missing                                                                                                                                                                                                                                                                                                                                                                | 1602883670                                           |
 | update_time      | False                                    | Auxiliary   | epoch timestamp in second, will be created automatically if missing                                                                                                                                                                                                                                                                                                                                                                | 1602883670                                           |
 
-For the same type of parameters, such as `host` and `hosts`, `remote_addr` and `remote_addrs` cannot exist at the same time, only one of them can be selected. If enabled at the same time, the API will respond with an error.
+There are three points that need special attention:
+
+- In addition to the required `uri`/`uris`, you must select at least one of the four categories `plugin`, `script`, `upstream`/`upstream_id` and `service_id`.
+- For the same type of parameters, such as `host` and `hosts`, `remote_addr` and `remote_addrs` cannot exist at the same time, only one of them can be selected. If enabled at the same time, the API will respond with an error.
+- When using `vars`, obtaining the value of `cookie` is case-sensitive. For example: `var` is "cookie\_`x_foo`" and `var` is "cookie\_`X_Foo`" means to get different `cookie`.

Review comment:
       Ditto

##########
File path: docs/en/latest/admin-api.md
##########
@@ -94,7 +94,11 @@ Note: When the `Admin API` is enabled, it will occupy the API prefixed with `/ap
 | create_time      | False                                    | Auxiliary   | epoch timestamp in second, will be created automatically if missing                                                                                                                                                                                                                                                                                                                                                                | 1602883670                                           |
 | update_time      | False                                    | Auxiliary   | epoch timestamp in second, will be created automatically if missing                                                                                                                                                                                                                                                                                                                                                                | 1602883670                                           |
 
-For the same type of parameters, such as `host` and `hosts`, `remote_addr` and `remote_addrs` cannot exist at the same time, only one of them can be selected. If enabled at the same time, the API will respond with an error.
+There are three points that need special attention:
+
+- In addition to the required `uri`/`uris`, you must select at least one of the four categories `plugin`, `script`, `upstream`/`upstream_id` and `service_id`.

Review comment:
       > t least one of the four categories `plugin`, `script`, `upstream`/`upstream_id` and `service_id`
   
   This is wrong.
   They can be put into two groups:
   plugin vs script
   upstream vs upstream_id vs service_id




-- 
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:
users@infra.apache.org