Hi,

I've tried to play with bidi using embedded nginx server and faced this 
problem:
Noticed that if I'm calling ring handler function directly, request map I'm 
receiving is correct, but then calling the same handler using bidi's 
routing map and make-handler function, reques map gets partly destroyed.
I suppose it's something to do with request type of nginx server whitch is 
of the nginx.clojure.clj.LazyRequestMap type, while for example jetty 
returns clojure.lang.PersistentHashMap.


Test code:
(defn index-handler [req]
  {:body (with-out-str (clojure.pprint/pprint req))})

(def routes
  ["/" {"" index-handler}])

(def bidi-handler
  (bidi.ring/make-handler routes))

;(def my-app index-handler)
(def my-app bidi-handler)

(nginx.clojure.embed/run-server my-app {:port 8181})



I'm getting this request map using make-handler:
{:body nil,
 :server-port "8181",
 :remote-addr "127.0.0.1",
 :scheme "http",
 :content-type nil,
 :websocket? false,
 :route-params nil}

This is request map using index-handler directly:
{:uri "/",
 :body nil,
 :headers
 {"Host" "localhost:8181",
  "Connection" "keep-alive",
  "Cache-Control" "max-age=0",
  "Accept"
  
"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
  "Upgrade-Insecure-Requests" "1",
  "User-Agent"
  "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like 
Gecko) Chrome/48.0.2564.109 Safari/537.36",
  "Accept-Encoding" "gzip, deflate, sdch",
  "Accept-Language"
  
"nb-NO,nb;q=0.8,no;q=0.6,nn;q=0.4,en-US;q=0.2,en;q=0.2,da;q=0.2,lt;q=0.2,sv;q=0.2,ceb;q=0.2",
  "Cookie"
  "__utma=111872281.1858584428.1455043971.1455043971.1455043971.1; 
__utmc=111872281; 
__utmz=111872281.1455043971.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)"},
 :server-port "8181",
 :server-name "",
 :remote-addr "127.0.0.1",
 :query-string nil,
 :scheme "http",
 :request-method :get,
 :content-type nil,
 :character-encoding nil,
 :websocket? false}

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to