且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

请求Content-Type为gzip时,Jetty会响应400 Bad Request

更新时间:2023-01-03 18:24:47

首先,从网上删除 GzipFilter .xml 它不再相关(从Jetty 9.3.0开始)

First, Remove GzipFilter from your web.xml it's not relevant anymore (starting with Jetty 9.3.0)

GzipHandler 是所有旧的基于过滤器的gzip过滤器的新替代品( GzipFilter AsyncGzipFilter IncludableGzipFilter )。

GzipHandler is the new replacement for all old filter based gzip filters (GzipFilter, AsyncGzipFilter, and IncludableGzipFilter).

它被设计为在连接流的基础上运行,这是基于过滤器的方法在异步I / O领域无法做到的。

It's been designed to function at a level more fundamental to the connection streams, something that the filter based approaches could not do in the world of Async I/O.

在Jetty 9.3.0中说... GzipHandler 只有针对Response主体内容设计的实现。 (就像之前的GzipFilters一样)

That being said ... GzipHandler in Jetty 9.3.0 only has an implementation designed for the Response body content. (Just like the GzipFilters of before)

然而,我们学到的是,有些项目扩展了我们的GzipFilter以添加Request内容体gzip处理。我们从GzipFilter到GzipHandler的更改中断了。

What we learned however, is that some projects extended our GzipFilter to add Request content body gzip handling as well. Which our change from GzipFilter to GzipHandler broke.

我们在 https://bugs.eclipse.org/471577 (DropWizard为自己的BiDiGzipFilter扩展了GzipFilter)

We have an open bug about that at https://bugs.eclipse.org/471577 (DropWizard extended GzipFilter for their own BiDiGzipFilter)

我们认识到可能存在Gzip在请求内容主体上的一些有用功能,但我们还没有实现。 (提示,提示,删除我们的补丁)

We recognize that there could be some useful functions for Gzip on the request content body, but we don't have an implementation for that yet. (hint, hint, drop a patch on us)