How to drop body of a request after checking headers in Servlet

后端 未结 2 1359
半阙折子戏
半阙折子戏 2021-01-21 22:15

I want to check the header of the request whether it contains a certain header or not before continuing with the body. For example, I want to check whether a multipart/form-data

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-21 22:59

    RFC 2616 says:

    An HTTP/1.1 (or later) client sending a message-body SHOULD monitor the network connection for an error status while it is transmitting the request. If the client sees an error status, it SHOULD immediately cease transmitting the body.

    So I disagree, this is not a HTTP limitation but a servlet one.

提交回复
热议问题