{"action":"created","issue":{"url":"https://api.github.com/repos/expressjs/serve-index/issues/27","labels_url":"https://api.github.com/repos/expressjs/serve-index/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/expressjs/serve-index/issues/27/comments","events_url":"https://api.github.com/repos/expressjs/serve-index/issues/27/events","html_url":"https://github.com/expressjs/serve-index/pull/27","id":55455894,"number":27,"title":"Ensure that links to directories end in a slash.","user":{"login":"geekmug","id":641790,"avatar_url":"https://avatars.githubusercontent.com/u/641790?v=3","gravatar_id":"","url":"https://api.github.com/users/geekmug","html_url":"https://github.com/geekmug","followers_url":"https://api.github.com/users/geekmug/followers","following_url":"https://api.github.com/users/geekmug/following{/other_user}","gists_url":"https://api.github.com/users/geekmug/gists{/gist_id}","starred_url":"https://api.github.com/users/geekmug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geekmug/subscriptions","organizations_url":"https://api.github.com/users/geekmug/orgs","repos_url":"https://api.github.com/users/geekmug/repos","events_url":"https://api.github.com/users/geekmug/events{/privacy}","received_events_url":"https://api.github.com/users/geekmug/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/expressjs/serve-index/labels/pr","name":"pr","color":"006b75"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-26T08:12:24Z","updated_at":"2015-01-26T17:38:25Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/expressjs/serve-index/pulls/27","html_url":"https://github.com/expressjs/serve-index/pull/27","diff_url":"https://github.com/expressjs/serve-index/pull/27.diff","patch_url":"https://github.com/expressjs/serve-index/pull/27.patch"},"body":"I use strict routing and missing slashes causes redirection."},"comment":{"url":"https://api.github.com/repos/expressjs/serve-index/issues/comments/71501864","html_url":"https://github.com/expressjs/serve-index/pull/27#issuecomment-71501864","issue_url":"https://api.github.com/repos/expressjs/serve-index/issues/27","id":71501864,"user":{"login":"geekmug","id":641790,"avatar_url":"https://avatars.githubusercontent.com/u/641790?v=3","gravatar_id":"","url":"https://api.github.com/users/geekmug","html_url":"https://github.com/geekmug","followers_url":"https://api.github.com/users/geekmug/followers","following_url":"https://api.github.com/users/geekmug/following{/other_user}","gists_url":"https://api.github.com/users/geekmug/gists{/gist_id}","starred_url":"https://api.github.com/users/geekmug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geekmug/subscriptions","organizations_url":"https://api.github.com/users/geekmug/orgs","repos_url":"https://api.github.com/users/geekmug/repos","events_url":"https://api.github.com/users/geekmug/events{/privacy}","received_events_url":"https://api.github.com/users/geekmug/received_events","type":"User","site_admin":false},"created_at":"2015-01-26T17:38:25Z","updated_at":"2015-01-26T17:38:25Z","body":"Whoops, sorry I spaced on the test cases. Originally, I was reluctant to change the applicaiton/json and text/plain output because of a fear of ambiguity if there was a path separator at the end of the file name (since in the HTML output a path separator in the file name would be encode into \"%2F\"), but I think it's fair to say that would be a very broken directory (I don't think POSIX even allows that).\r\n\r\nThe other output types previously didn't call fs.stat for the directory contents, so I pulled that up into the main serveIndex function. As a side-effect of that, the html output now calls stat twice on each file in the directory. I wanted to change the \"files\" argument to be the ```{ name: file, stat: stats[i] }``` objects used in the html function, but that breaks the public API. Unfortunately, the html export uses extra information from the stat to do the \"details\" view, so it's not trivial to eliminate. However, it's extremely likely the 2nd stat calls will be cached, so it probably will have no performance impact"}}