{"action":"created","issue":{"url":"https://api.github.com/repos/WilliamDASILVA/nuxt-trailingslash-module/issues/1","repository_url":"https://api.github.com/repos/WilliamDASILVA/nuxt-trailingslash-module","labels_url":"https://api.github.com/repos/WilliamDASILVA/nuxt-trailingslash-module/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/WilliamDASILVA/nuxt-trailingslash-module/issues/1/comments","events_url":"https://api.github.com/repos/WilliamDASILVA/nuxt-trailingslash-module/issues/1/events","html_url":"https://github.com/WilliamDASILVA/nuxt-trailingslash-module/pull/1","id":274391883,"number":1,"title":"Fix redirect to work with plain node ServerResponse","user":{"login":"IlyaSemenov","id":128121,"avatar_url":"https://avatars1.githubusercontent.com/u/128121?v=4","gravatar_id":"","url":"https://api.github.com/users/IlyaSemenov","html_url":"https://github.com/IlyaSemenov","followers_url":"https://api.github.com/users/IlyaSemenov/followers","following_url":"https://api.github.com/users/IlyaSemenov/following{/other_user}","gists_url":"https://api.github.com/users/IlyaSemenov/gists{/gist_id}","starred_url":"https://api.github.com/users/IlyaSemenov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IlyaSemenov/subscriptions","organizations_url":"https://api.github.com/users/IlyaSemenov/orgs","repos_url":"https://api.github.com/users/IlyaSemenov/repos","events_url":"https://api.github.com/users/IlyaSemenov/events{/privacy}","received_events_url":"https://api.github.com/users/IlyaSemenov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-16T04:33:49Z","updated_at":"2017-11-16T09:30:34Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/WilliamDASILVA/nuxt-trailingslash-module/pulls/1","html_url":"https://github.com/WilliamDASILVA/nuxt-trailingslash-module/pull/1","diff_url":"https://github.com/WilliamDASILVA/nuxt-trailingslash-module/pull/1.diff","patch_url":"https://github.com/WilliamDASILVA/nuxt-trailingslash-module/pull/1.patch"},"body":"The module crashes with **res.redirect is not a function** in this line:\r\n\r\n```js\r\n  this.addServerMiddleware((req, res, next) => {\r\n...\r\n        res.redirect(301, redirect); // <---------------\r\n```\r\n\r\n`res` there is an object of type `ServerResponse`, which doesn't have `redirect` method indeed: https://nodejs.org/api/http.html\r\n\r\nI guess you only tested it with Express or some other framework which silently extends ServerResponse class.\r\n\r\nThe PR makes the module compatible with plain node http."},"comment":{"url":"https://api.github.com/repos/WilliamDASILVA/nuxt-trailingslash-module/issues/comments/344865737","html_url":"https://github.com/WilliamDASILVA/nuxt-trailingslash-module/pull/1#issuecomment-344865737","issue_url":"https://api.github.com/repos/WilliamDASILVA/nuxt-trailingslash-module/issues/1","id":344865737,"user":{"login":"WilliamDASILVA","id":2766008,"avatar_url":"https://avatars3.githubusercontent.com/u/2766008?v=4","gravatar_id":"","url":"https://api.github.com/users/WilliamDASILVA","html_url":"https://github.com/WilliamDASILVA","followers_url":"https://api.github.com/users/WilliamDASILVA/followers","following_url":"https://api.github.com/users/WilliamDASILVA/following{/other_user}","gists_url":"https://api.github.com/users/WilliamDASILVA/gists{/gist_id}","starred_url":"https://api.github.com/users/WilliamDASILVA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WilliamDASILVA/subscriptions","organizations_url":"https://api.github.com/users/WilliamDASILVA/orgs","repos_url":"https://api.github.com/users/WilliamDASILVA/repos","events_url":"https://api.github.com/users/WilliamDASILVA/events{/privacy}","received_events_url":"https://api.github.com/users/WilliamDASILVA/received_events","type":"User","site_admin":false},"created_at":"2017-11-16T09:30:34Z","updated_at":"2017-11-16T09:30:34Z","author_association":"OWNER","body":"@IlyaSemenov Indeed, thank you for your pull request !"}}
{"actor":{"display_login":"WilliamDASILVA"}}