Fork me on GitHub
#reitit
<
2020-10-19
>
ikitommi07:10:38

two days, three releases, latest being: [metosin/reitit "0.5.9"] - https://github.com/metosin/reitit/blob/master/CHANGELOG.md. Thanks to all contributors!

👏 9
dharrigan09:10:24

works great!

👍 3
timo15:10:27

Hi! I am having a problem here. A client is sending data to my reitit-server. It fails with 500 and there is an error log com.fasterxml.jackson.core.JsonParseException: Illegal character ((CTRL-CHAR, code 31)): only regular white space (\r, \n, \t) is allowed between tokens. The payload is sent by the client to the server with gzip compression. Is the problem here that my reitit-server does not decompress a gzipped payload? Is there a way to dump the payload any further? In the reitit output it is only shown as :body #<org.eclipse.jetty.server.HttpInputOverHTTP@408d23e HttpInputOverHTTP@408d23e[c=0,q=0,[0]=null,s=STREAM]> Is amalloy/ring-gzip-middleware sufficient to decompress client payloads? Is it set correctly to do that in this route-opts?

(def route-opts                                                                                                                                                            
  {:reitit.middleware/transform dev/print-request-diffs ;; pretty diffs                                                                                                    
   ;;:validate spec/validate ;; enable spec validation for route data                                                                                                      
   ;;:reitit.spec/wrap spell/closed ;; strict top-level validation                                                                                                         
   ;;:exception pretty/exception                                                                                                                                           
   :data      {:coercion   reitit.coercion.spec/coercion                                                                                                                   
               :muuntaja   muuntaja-instance                                                                                                                               
               :middleware [gzip/wrap-gzip                                                                                                                                 
                            swagger/swagger-feature                                                                                                                        
                            parameters/parameters-middleware                                                                                                               
                            muuntaja/format-negotiate-middleware                                                                                                           
                            muuntaja/format-response-middleware                                                                                                            
                            ;;exception/exception-middleware                                                                                                               
                            muuntaja/format-request-middleware                                                                                                             
                            coercion/coerce-response-middleware                                                                                                            
                            coercion/coerce-request-middleware                                                                                                             
                            multipart/multipart-middleware]}})                                                                                                             

ikitommi20:10:57

@timok looks legit. Using a reverse proxy for that might be much faster.

timo20:10:44

hmm, :thinking_face: a revproxy for gzip then? worth a try. thanks

emil0r20:10:39

@timok nginx works really well with that