David Smith
2015-03-01 15:11:08 UTC
I have some middleware that I want to inspect the url of the request and
change it under certain circumstances. To demonstrate this I have the
following code:
(require '[aleph.http :as http]
'[aleph.http.client-middleware :as mw])
(defn alter-url-middleware
[client]
(fn [req]
(client (merge req (mw/parse-url "http://www.yahoo.com")))))
@(http/get "http://www.google.com" {:middleware alter-url-middleware})
However this code returns the response for google, not for yahoo. What am
I doing wrong?
change it under certain circumstances. To demonstrate this I have the
following code:
(require '[aleph.http :as http]
'[aleph.http.client-middleware :as mw])
(defn alter-url-middleware
[client]
(fn [req]
(client (merge req (mw/parse-url "http://www.yahoo.com")))))
@(http/get "http://www.google.com" {:middleware alter-url-middleware})
However this code returns the response for google, not for yahoo. What am
I doing wrong?
--
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aleph-lib+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Aleph" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aleph-lib+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.