-
由 Steve Xuereb 创作于
What --- Handle [ProtocolError](https://cs.opensource.google/go/go/+/master:src/net/textproto/textproto.go;drc=ee6b34797b66b957fdf9b7211ee3f0b80ac57758;l=46) for multipart upload. Why --- When a user sends an invalid `Content-Disposition` Go sends a [malformed MIME header line](https://cs.opensource.google/go/go/+/master:src/net/textproto/reader.go;l=526?q=%22malformed%20MIME%20header%20line%22&ss=go%2Fgo) and we end up returning a 500 error instead of a 400 error. Since this is an invalid value that our user sends we need to return a 400 instead of 500, so it doesn't attribute to our error rate, and to indicate the user did something wrong. Reference: https://gitlab.com/gitlab-org/gitlab/-/issues/432533 Changelog: fixed Signed-off-by:
Steve Xuereb <sxuereb@gitlab.com>
由 Steve Xuereb 创作于What --- Handle [ProtocolError](https://cs.opensource.google/go/go/+/master:src/net/textproto/textproto.go;drc=ee6b34797b66b957fdf9b7211ee3f0b80ac57758;l=46) for multipart upload. Why --- When a user sends an invalid `Content-Disposition` Go sends a [malformed MIME header line](https://cs.opensource.google/go/go/+/master:src/net/textproto/reader.go;l=526?q=%22malformed%20MIME%20header%20line%22&ss=go%2Fgo) and we end up returning a 500 error instead of a 400 error. Since this is an invalid value that our user sends we need to return a 400 instead of 500, so it doesn't attribute to our error rate, and to indicate the user did something wrong. Reference: https://gitlab.com/gitlab-org/gitlab/-/issues/432533 Changelog: fixed Signed-off-by:
Steve Xuereb <sxuereb@gitlab.com>
代码所有者
将用户和群组指定为特定文件更改的核准人。 了解更多。
uploads_test.go 16.98 KiB