{"action":"closed","issue":{"url":"https://api.github.com/repos/cemerick/friend/issues/136","labels_url":"https://api.github.com/repos/cemerick/friend/issues/136/labels{/name}","comments_url":"https://api.github.com/repos/cemerick/friend/issues/136/comments","events_url":"https://api.github.com/repos/cemerick/friend/issues/136/events","html_url":"https://github.com/cemerick/friend/issues/136","id":54883310,"number":136,"title":"Turns nil responses into empty maps","user":{"login":"logaan","id":9669,"avatar_url":"https://avatars.githubusercontent.com/u/9669?v=3","gravatar_id":"","url":"https://api.github.com/users/logaan","html_url":"https://github.com/logaan","followers_url":"https://api.github.com/users/logaan/followers","following_url":"https://api.github.com/users/logaan/following{/other_user}","gists_url":"https://api.github.com/users/logaan/gists{/gist_id}","starred_url":"https://api.github.com/users/logaan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/logaan/subscriptions","organizations_url":"https://api.github.com/users/logaan/orgs","repos_url":"https://api.github.com/users/logaan/repos","events_url":"https://api.github.com/users/logaan/events{/privacy}","received_events_url":"https://api.github.com/users/logaan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-20T13:34:06Z","updated_at":"2015-03-13T10:38:07Z","closed_at":"2015-03-13T10:38:07Z","body":"This code, more or less taken from the example app\r\n\r\n```clojure\r\n(friend/authenticate\r\n        {:allow-anon? true\r\n         :login-uri \"/login\"\r\n         :default-landing-uri \"/\"\r\n         :unauthorized-handler\r\n         #(-> (hiccup/html\r\n                [:h2 \"You do not have sufficient privileges to access \"\r\n                 (:uri %)])\r\n              resp/response\r\n              (resp/status 401))\r\n         :credential-fn #(creds/bcrypt-credential-fn @users %)\r\n         :workflows [(workflows/interactive-form)]})\r\n```\r\n\r\nWill take a nil response and turn it into a {}. Nil responses in ring mean that there has been no match up to that point. This may not be an issue on it's own but other libraries (such as ring-defaults) see the empty map and decide that a match has been found and make their modifications to the response (like inserting headers). This can turn a response that should be a 404 into a very confusing 200.\r\n\r\nDesired behaviour is nil in, nil out."}}