{"action":"created","issue":{"url":"https://api.github.com/repos/NancyFx/Nancy/issues/2589","repository_url":"https://api.github.com/repos/NancyFx/Nancy","labels_url":"https://api.github.com/repos/NancyFx/Nancy/issues/2589/labels{/name}","comments_url":"https://api.github.com/repos/NancyFx/Nancy/issues/2589/comments","events_url":"https://api.github.com/repos/NancyFx/Nancy/issues/2589/events","html_url":"https://github.com/NancyFx/Nancy/issues/2589","id":183955901,"number":2589,"title":"RequestExtensions.IsLocal returning false on local url even though Nancy.Request.UserHostAddress is \"127.0.0.1\" ","user":{"login":"dcr26","id":1127896,"avatar_url":"https://avatars.githubusercontent.com/u/1127896?v=3","gravatar_id":"","url":"https://api.github.com/users/dcr26","html_url":"https://github.com/dcr26","followers_url":"https://api.github.com/users/dcr26/followers","following_url":"https://api.github.com/users/dcr26/following{/other_user}","gists_url":"https://api.github.com/users/dcr26/gists{/gist_id}","starred_url":"https://api.github.com/users/dcr26/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcr26/subscriptions","organizations_url":"https://api.github.com/users/dcr26/orgs","repos_url":"https://api.github.com/users/dcr26/repos","events_url":"https://api.github.com/users/dcr26/events{/privacy}","received_events_url":"https://api.github.com/users/dcr26/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-19T13:04:38Z","updated_at":"2016-10-19T13:08:22Z","closed_at":null,"body":"### Prerequisites\r\n\r\n### Description\r\nI need to check that a request I receive is coming from the local machine before I serve this request.\r\n\r\n### Steps to Reproduce\r\nStart a nancy server, and in a module determine if the request is from a local address as below:\r\n\r\n`bool isLocalRequest = _nancyContext.Request.IsLocal();`\r\n\r\nFYI - the _nancyContext.Request.UserHostAddress = \"127.0.0.1\"\r\n\r\nI expect isLocalRequest to be true but that is not the case. \r\n\r\n### System Configuration\r\n\r\n- Nancy version:  Nancy, Version=1.4.1.0\r\n- Nancy host\r\n  - [ ] ASP.NET\r\n  - [ ] OWIN\r\n  - [ X ] Self-Hosted\r\n  - [ ] Other:\r\n- Environment (Operating system, version and so on): Win 10 x64 \r\n- .NET Framework version: 4.6\r\n- Additional information:\r\n\r\nSorry to add fix but this is what I have done to rectify the issue:\r\n`if (_nancyContext.Request.UserHostAddress == \"127.0.0.1\" || _nancyContext.Request.UserHostAddress== \"::1\") isLocalRequest = true;`\r\n\r\n\r\n<!-- Thanks for reporting the issue to Nancy! -->\r\n"},"comment":{"url":"https://api.github.com/repos/NancyFx/Nancy/issues/comments/254807069","html_url":"https://github.com/NancyFx/Nancy/issues/2589#issuecomment-254807069","issue_url":"https://api.github.com/repos/NancyFx/Nancy/issues/2589","id":254807069,"user":{"login":"dcr26","id":1127896,"avatar_url":"https://avatars.githubusercontent.com/u/1127896?v=3","gravatar_id":"","url":"https://api.github.com/users/dcr26","html_url":"https://github.com/dcr26","followers_url":"https://api.github.com/users/dcr26/followers","following_url":"https://api.github.com/users/dcr26/following{/other_user}","gists_url":"https://api.github.com/users/dcr26/gists{/gist_id}","starred_url":"https://api.github.com/users/dcr26/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dcr26/subscriptions","organizations_url":"https://api.github.com/users/dcr26/orgs","repos_url":"https://api.github.com/users/dcr26/repos","events_url":"https://api.github.com/users/dcr26/events{/privacy}","received_events_url":"https://api.github.com/users/dcr26/received_events","type":"User","site_admin":false},"created_at":"2016-10-19T13:08:22Z","updated_at":"2016-10-19T13:08:22Z","body":"local.Mydomain.com which has a DNS entry to 127.0.0.1"}}
{"actor":{"display_login":"dcr26"}}