{"action":"created","issue":{"url":"https://api.github.com/repos/weavejester/duct/issues/15","labels_url":"https://api.github.com/repos/weavejester/duct/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/weavejester/duct/issues/15/comments","events_url":"https://api.github.com/repos/weavejester/duct/issues/15/events","html_url":"https://github.com/weavejester/duct/issues/15","id":110713177,"number":15,"title":"Leaking middleware?","user":{"login":"kendagriff","id":110935,"avatar_url":"https://avatars.githubusercontent.com/u/110935?v=3","gravatar_id":"","url":"https://api.github.com/users/kendagriff","html_url":"https://github.com/kendagriff","followers_url":"https://api.github.com/users/kendagriff/followers","following_url":"https://api.github.com/users/kendagriff/following{/other_user}","gists_url":"https://api.github.com/users/kendagriff/gists{/gist_id}","starred_url":"https://api.github.com/users/kendagriff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kendagriff/subscriptions","organizations_url":"https://api.github.com/users/kendagriff/orgs","repos_url":"https://api.github.com/users/kendagriff/repos","events_url":"https://api.github.com/users/kendagriff/events{/privacy}","received_events_url":"https://api.github.com/users/kendagriff/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-09T18:28:25Z","updated_at":"2015-10-09T21:52:58Z","closed_at":null,"body":"Is it possible for middleware wrapping `routes` in one endpoint to leak into the `routes` of a separate endpoint?\r\n\r\nI think I'm seeing such behavior. If that's not right, I'll try posting a reproducible example."},"comment":{"url":"https://api.github.com/repos/weavejester/duct/issues/comments/146994936","html_url":"https://github.com/weavejester/duct/issues/15#issuecomment-146994936","issue_url":"https://api.github.com/repos/weavejester/duct/issues/15","id":146994936,"user":{"login":"weavejester","id":8780,"avatar_url":"https://avatars.githubusercontent.com/u/8780?v=3","gravatar_id":"","url":"https://api.github.com/users/weavejester","html_url":"https://github.com/weavejester","followers_url":"https://api.github.com/users/weavejester/followers","following_url":"https://api.github.com/users/weavejester/following{/other_user}","gists_url":"https://api.github.com/users/weavejester/gists{/gist_id}","starred_url":"https://api.github.com/users/weavejester/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weavejester/subscriptions","organizations_url":"https://api.github.com/users/weavejester/orgs","repos_url":"https://api.github.com/users/weavejester/repos","events_url":"https://api.github.com/users/weavejester/events{/privacy}","received_events_url":"https://api.github.com/users/weavejester/received_events","type":"User","site_admin":false},"created_at":"2015-10-09T21:52:58Z","updated_at":"2015-10-09T21:52:58Z","body":"Your middleware isn't passing the request onto the handler. You're returning the request as though it were a response instead, and because you're *always* returning a response from `endpoint-1`, you're effectively declaring that it handles all URLs and `endpoint-2` should be ignored.\r\n\r\nYou instead want something like:\r\n\r\n```clojure\r\n(defn wrap-example [handler]\r\n  (fn [req]\r\n    (handler (header req \"X-EXAMPLE\" true))))\r\n```"}}