Fork me on GitHub
#duct
<
2022-09-22
>
erwinrooijakkers08:09:54

How to configure Jetty in Duct to accept larger headers? Error message when sending a request with cookies that are more than the 8kb default:

10:20:40.277 WARN  org.eclipse.jetty.http.HttpParser - Header is too large 8193>8192

erwinrooijakkers08:09:15

Ah it’s a Ring Jetty Adapter, maybe explicitly add the key

{:duct.server.http/jetty
 {:port    3000
  :handler (fn [request]
             {:status  200
              :headers {"Content-Type" "text/plain"}
              :body    "Hello World"})}}
and configure there

erwinrooijakkers08:09:45

And indeed also contains

:request-header-size    - the maximum size of a request header (default 8192)
:response-header-size   - the maximum size of a response header (default 8192)

erwinrooijakkers08:09:56

:duct.module.web/api {}
 :duct.server.http/jetty {:port 3000
                          :response-header-size 16384
                          :request-header-size 16384}}

;;=> 
10:35:32.432 INFO  org.eclipse.jetty.server.Server - Started @28171ms
Execution error (AssertionError) at integrant.core/prep (core.cljc:412).
Assert failed: (map? config)

erwinrooijakkers08:09:10

Putting it in :duct.profile/base seems to work

erwinrooijakkers08:09:55

:duct.server.http/jetty {:response-header-size 16384
                           :request-header-size 16384}