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

[GitHub] [apisix] youzhixiaomutou opened a new issue, #9643: help request: 高级路由匹配规则中 post 参数为什么只支持 application/x-www-form-urlencoded?

youzhixiaomutou opened a new issue, #9643:
URL: https://github.com/apache/apisix/issues/9643

   ### Description
   
   In lines 260 - 272 of the ctx.lua file,  it is hard-coded "Content-Type") == "application/x-www-form-urlencoded":
   
   ``` lua
   elseif core_str.has_prefix(key, "post_arg_") then
       -- only match default post form
       if request.header(nil, "Content-Type") == "application/x-www-form-urlencoded" then
           local arg_key = sub_str(key, 10)
           local args = request.get_post_args()[arg_key]
           if args then
               if type(args) == "table" then
                   val = args[1]
               else
                   val = args
               end
           end
       end
   ```
   According to https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type, why not support such as "Content-Type" == "application/x-www-form-urlencoded; charset=utf8" as Content-Type?
   
   ### Environment
   
   - APISIX version (run `apisix version`): v3.2.1
   - Operating system (run `uname -a`):
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`):
   - etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`):
   - APISIX Dashboard version, if relevant:
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `luarocks --version`):


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix] youzhixiaomutou closed issue #9643: help request: Why does the post parameter in the advanced route matching rule only support application/x-www-form-urlencoded?

Posted by "youzhixiaomutou (via GitHub)" <gi...@apache.org>.
youzhixiaomutou closed issue #9643: help request: Why does the post parameter in the advanced route matching rule only support application/x-www-form-urlencoded?
URL: https://github.com/apache/apisix/issues/9643


-- 
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] shreemaan-abhishek commented on issue #9643: help request: Why does the post parameter in the advanced route matching rule only support application/x-www-form-urlencoded?

Posted by "shreemaan-abhishek (via GitHub)" <gi...@apache.org>.
shreemaan-abhishek commented on issue #9643:
URL: https://github.com/apache/apisix/issues/9643#issuecomment-1588758438

   (subscribed)


-- 
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] Revolyssup commented on issue #9643: help request: Why does the post parameter in the advanced route matching rule only support application/x-www-form-urlencoded?

Posted by "Revolyssup (via GitHub)" <gi...@apache.org>.
Revolyssup commented on issue #9643:
URL: https://github.com/apache/apisix/issues/9643#issuecomment-1596565756

   This function is just an abstraction over ngx API where the `ngx.req.get_post_args` method specifies[1] that it returns query args for mime type `application/x-www-form-urlencoded`. The code here is just following the ngx API. Moreover there is no charset parameter defined for this mime type. Please refer here[2][3].
   
   1. https://openresty-reference.readthedocs.io/en/latest/Lua_Nginx_API/#ngxreqget_post_args
   2. https://stackoverflow.com/questions/16819502/application-x-www-form-urlencoded-and-charset-utf-8#:~:text=The%20application%2Fx%2Dwww%2D,which%20the%20name%20is%20_charset%20.
   3. https://url.spec.whatwg.org/#application/x-www-form-urlencoded


-- 
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] Revolyssup commented on issue #9643: help request: Why does the post parameter in the advanced route matching rule only support application/x-www-form-urlencoded?

Posted by "Revolyssup (via GitHub)" <gi...@apache.org>.
Revolyssup commented on issue #9643:
URL: https://github.com/apache/apisix/issues/9643#issuecomment-1649174985

   @youzhixiaomutou Can you close the issue if your query was answered?


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