0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

競合や重複設定の可能性があるHTTPヘッダーのキー

Posted at

競合や重複設定の可能性があるヘッダー

以下のヘッダーは、Tomcatでも自動で入りうるし、Spring/reactor-netty でもアプリケーション側で設定されがちです:

1.Content-Type

Springでは @ResponseBody, @RequestMapping(produces="...") によって明示的に設定される。

Tomcatでも response.getWriter() などを呼ぶと自動的に text/plain などが設定されることがある。

2.Content-Length

明示的に .write() して完全なバイト数がわかっている場合は Tomcat が自動設定。

Springでも ResponseEntity などで body に String を指定すれば自動計算される。

WebFlux / Reactor Netty では Flux/Mono のサイズが確定しない場合は Transfer-Encoding: chunked になる。

3.Transfer-Encoding

Tomcat:HTTP/1.1で Content-Length がないと chunked を自動設定。

Reactor Netty:デフォルトで chunked を使う(バッファリングしないストリーム型処理が前提)。

Spring WebFlux:Reactor Nettyに任せるが、条件次第で Transfer-Encoding: chunked になる。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?