We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
mosn/pkg/stream/http/stream.go
Line 512 in 9409ffa
这里解析Http请求直接使用的fasthttp的ReadLimitBody方式,但是这存在一个问题,它这里默认提前对MultipartForm类型进行了body解析,如图:
这里稍微解析出错,可能会导致body解析的内容缺少,然后导致转发的时候缺少body内容。
这里默认情况,作为网关,是不是不应该对body内容进行解析,只做转发即可,用户需要解析form这类的情况,自己再另行处理。 这里更多考虑的是兼容性问题
举例: 目前MultipartForm格式标准如下:
POST /upload HTTP/1.1 Host: example.com Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="file"; filename="example.txt" Content-Type: text/plain This is an example file. ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="submit" Upload File ------WebKitFormBoundary7MA4YWxkTrZu0gW--
但是假如我其中一个part缺少了Content-Disposition字段,那么就会导致解析出来的body缺失一段数据,从而导致转发到后端的请求body内容缺失
The text was updated successfully, but these errors were encountered:
No branches or pull requests
mosn/pkg/stream/http/stream.go
Line 512 in 9409ffa
这里解析Http请求直接使用的fasthttp的ReadLimitBody方式,但是这存在一个问题,它这里默认提前对MultipartForm类型进行了body解析,如图:
这里稍微解析出错,可能会导致body解析的内容缺少,然后导致转发的时候缺少body内容。
这里默认情况,作为网关,是不是不应该对body内容进行解析,只做转发即可,用户需要解析form这类的情况,自己再另行处理。
这里更多考虑的是兼容性问题
举例:
目前MultipartForm格式标准如下:
但是假如我其中一个part缺少了Content-Disposition字段,那么就会导致解析出来的body缺失一段数据,从而导致转发到后端的请求body内容缺失
The text was updated successfully, but these errors were encountered: