Clojure / Ring: Using the ring pier adapter, large requests give me error 413: FULL HEAD.

Using the Ring Jetty adapter, if my request is too large, I get 413: FULL HEAD error. I tracked it down to a property called headerbuffersize, but when I try to set it in a run-jetty call, I still get 413. Is there a better way to control the jetty configuration from Ring?

(ring/run-jetty (var app) {:port port :join? false :headerbuffersize 1048576}) 

What is the right way to do this?

Thanks!

+4
source share
1 answer

I think this should work:

 (def header-buffer-size 1048576) (def config {:host "example.com" :port 8080 ; join? false ; and any other options... :configurator (fn [jetty] (doseq [connector (.getConnectors jetty)] (.setHeaderBufferSize connector header-buffer-size))) }) 
+7
source

Source: https://habr.com/ru/post/1396514/


All Articles