-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
openapi请求如果key是a.bS/TT/AT,则报404错误 #4447
Comments
tomcat路径中允许未编码的字符和查询字符串中允许的未编码字符,
|
那这就比较尴尬了,在网页上操作是允许放 / 字符的,在openapi就不行了,那应该怎么办? |
那这就比较尴尬了,在网页上操作是允许放 / 字符的,在openapi就不行了,那应该怎么办? |
tomcat具体支持哪些字符不重要,重要的是所有客户端必须严格按照HTTP协议规定的格式发送请求,该怎么编码就怎么编码,不能与具体哪一个web container绑定。
… On Jul 8, 2022, at 11:13, PeterHang ***@***.***> wrote:
tomcat路径中允许未编码的字符和查询字符串中允许的未编码字符,/字符不在范围内
" < > [ \ ] ^ ` { | }
<https://user-images.githubusercontent.com/42887532/177584445-a2450cce-999c-44bd-8ce1-a249335a73c7.png> tomcat attribute <https://tomcat.apache.org/tomcat-8.5-doc/config/http.html>
那这就比较尴尬了,在网页上操作是允许放 / 字符的,在openapi就不行了,那应该怎么办?
总不能因为网页上key是放在body里面,openapi的key是在url里面,然后有些key的字符在open api就不支持,对吧?
—
Reply to this email directly, view it on GitHub <#4447 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AASQE76E63SX7N76INUPDILVS6MEPANCNFSM52YHMFWA>.
You are receiving this because you are subscribed to this thread.
|
|
造成这个差异的原因是通过页面修改/删除配置的接口没有把 key 放在 url path 上,而 open api 的实现是把 key 放在 url path 上的。 apollo/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ItemController.java Lines 109 to 113 in 3440475
apollo/apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/ItemController.java Lines 123 to 127 in 3440475
Lines 84 to 89 in 3440475
Lines 115 to 120 in 3440475
|
|
@PeterHang 是的,更新还好搞一些,PUT 操作可以把 item key 放在 body 里面,查询和删除这两个操作比较麻烦,GET 和 DELETE 只能放在 url path 上 |
what if we just encode/decode the item key ? we can provide new interface on get/update/delete , and we encode the item key in client and decode key in admin service. in this way , the old client can also work normally. what do you think ? @nobodyiam |
有什么进展吗?考虑更新支持key中带/的openapi更新吗? |
@AbnerHuang2 I'm interested in this proposal, would you please give an example to show your idea? |
take getItem as an example, when we called getItem with openapi client, we can encode the key like the follow way,
and this will execute in portal/ItemOpenController, and in this controller passthrough the key to adminservice/ItemController, and in adminservice/ItemController we decode the key like follow way,
then we can get the correct result. ps, the encode/decode algorithm can be replace with other simple algorithm if their is more effective encode/decode algorithm. |
This is an interesting proposal! In this way, we could add a new set of open apis that accept encoded keys. |
wow, this way is more practicable, in the normal sutuation, it works like the old workflow, and we just use little cost to deal with unexpectable key, I'll try this. but I need to finished #4519 first. |
In my situation, I wrote a apollo portal http client, that also works. |
Does the newclient can open to work now?Could you share me the note ?thanks
…---原始邮件---
发件人: "Jason ***@***.***>
发送时间: 2022年8月19日(周五) 上午8:59
收件人: ***@***.***>;
抄送: ***@***.******@***.***>;
主题: Re: [apolloconfig/apollo] openapi请求如果key是a.bS/TT/AT,则报404错误 (Issue #4447)
what if we just encode/decode the item key ? we can provide new interface on get/update/delete , and we encode the item key in client and decode key in admin service. in this way , the old client can also work normally. what do you think ?
@AbnerHuang2 I'm interested in this proposal, would you please give an example to show your idea?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
@snowy861227 This fix was merged to the master branch and not yet released. |
openapi的Java client,1.7.0,如果key是a.bS/TT/AT,则请求就会报404错误。上次修完后,[]是可以了,但是key为a.bS/TT/AT还是不行,只不过这次报404了
The text was updated successfully, but these errors were encountered: