2

我正在尝试将标头Connection: Keep-Alive放在 lib/app/endpoint.ex 中:

plug Plug.Static,
  at: "/", from: :app, gzip: true,
  only: ~w(css fonts images js favicon.ico robots.txt),
  etag_generation: {},
  cache_control_for_etags: "public, max-age=3153600",
  headers: %{"connection" => "keep-alive"}

但是当我跑步时curl -I -k -H "Accept-Encoding: gzip" http://localhost:4000

HTTP/1.1 200 OK
server: Cowboy
date: Fri, 24 Feb 2017 11:34:37 GMT
content-encoding: gzip
content-length: 5613
set-cookie: _app_key=...; path=/; HttpOnly
content-type: text/html; charset=utf-8
cache-control: max-age=0, private, must-revalidate
x-request-id: aafhn9sq18vpajadu1h7709vmb1f4jrg
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
x-content-type-options: nosniff

它不返回标头:connection: keep-alive

这是正常的还是我搞砸了什么?

4

0 回答 0