gpt4 book ai didi

spring - 使用 tukey,当特定参数存在时从 url 中删除所有查询字符串参数

转载 作者:行者123 更新时间:2023-11-28 23:36:16 27 4
gpt4 key购买 nike

我刚接触到 tucker,正在尝试在 pentaho 服务器(spring)中重写 url 查询参数。

我想做的是:重写

http://hostname:8080/pentaho/api/repos/:public:Steel%20Wheels:Regional%20Sales%20%28dashboard%29.xdash/viewer?token=ABC-1234-42rheRFrhewu2425-ticket&username=popcorn

http://hostname:8080/pentaho/api/repos/:public:Steel%20Wheels:Regional%20Sales%20%28dashboard%29.xdash/viewer

对我不起作用的事情:

<rule>
<from>^/viewer$</from>
<to type="redirect" last="true">/viewer</to>
</rule>

<rule>
<condition type="parameter" name="token" operator="equal">(*)</condition>
<from>^/viewer$</from>
<to type="permanent-redirect" last="true">viewer</to>
</rule>

和许多变体。还检查了旧帖子。我知道我可能对正则表达式做错了什么,或者配置完全关闭了。任何指针表示赞赏。

最佳答案

完全忘记了这个问题,因为没有人回答。回答我自己,以防有人发现自己处于相同的位置。

<rule>
<condition type="parameter" name="token" operator="equal">(*)</condition>
<from>^/viewer(.*)$</from>
<to type="permanent-redirect" last="true">viewer</to>
</rule>

关于spring - 使用 tukey,当特定参数存在时从 url 中删除所有查询字符串参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24212594/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com