antJack

Results 19 comments of antJack

感谢提问 正常情况下,Path 是由 PathOri 经过规范化(normalize)得来的,但 MOSN 中允许上层 filter 修改 Path 的内容,例如在一些路由场景中,可能会进行 path-rewrite,把请求的原始 path 修改为其它值。这个测试用例就反映了这种情况,因此出现 Path 和 PathOri 不一致的现象。 MOSN 处理请求 Path 的原则是:如果用户修改了Path,那么使用修改后的Path;如果没有修改,则原封不动的使用原始 Path 因此 buildUrlFromCtxVar 里 u := url.URL{Path: }...

试了下确实有这个现象,应该是 fasthttp 的 bug > fasthttp.URI{}.SetPath("/%2Fsample") --> "/sample" 这个结果是错的,SetPath 里面会先把所有 % 的部分解码成原字符,例如 “%2f” -> "/",然后再去除重复的 “/” 等特殊字符 在 "/%2Fsample" 这个输入里,“/%2F” 作为用户自定义输入的一部分(特地被转成了安全的“%2f”),不应该被视为 “/” 而被删除掉,应该保留下来才对的,比如 go 官方的 url 包就保留了这个 “/” 类似的,在 chromium...

最好的做法应该是给 fasthttp 提 issue 和 mr,修复之后再更新 mosn 依赖的 fasthttp 版本。 如果你们现在急用的话,也可以考虑在 buildUrlFromCtxVar 判断完 path == unescapedPath 失败之后,再用 fasthttp 的补充判断一下,并记个 TODO 和单测,待 fasthttp 修复后再删除。 直接改 u := url.URL{Path: path} -> u...

直接用 fasthttp 的话,是不是处理不了这种情况: pathOri = "/%2F%2F%2Fsample",然后用户把 path 改成了 "/sample" 现在官方 url 包跟 fasthttp 包似乎都有 bad case,得看看怎么处理最好。MR 当前状态对既有代码影响小,就先合了

still unable to debug embedded Go? or are there any solutions?

Thanks for reply. I am working on the MOSN project, another proxy for service mesh written in Golang. We are also trying to support the proxy-wasm ABI on MOSN.

Thanks for replying. The word ‘contribute’ may be somewhat misleading, since the proxy-wasm-go-host project has already belonged to the *group* mosn.io, though I’m trying my best to make it out...

![image](https://user-images.githubusercontent.com/52443884/202645489-d845d91c-8cad-4365-a1c3-85f0a34f5802.png)

mosn filter's API already provide accessibility to http header/body/trailer ``` func (f *filter) OnReceive(ctx context.Context, headers HeaderMap, body IoBuffer, trailers HeaderMap) StreamFilterStatus ^^^ func (f *Filter) Append(ctx context.Context, headers api.HeaderMap,...