{"action":"opened","issue":{"url":"https://api.github.com/repos/hapijs/hapi/issues/3761","repository_url":"https://api.github.com/repos/hapijs/hapi","labels_url":"https://api.github.com/repos/hapijs/hapi/issues/3761/labels{/name}","comments_url":"https://api.github.com/repos/hapijs/hapi/issues/3761/comments","events_url":"https://api.github.com/repos/hapijs/hapi/issues/3761/events","html_url":"https://github.com/hapijs/hapi/issues/3761","id":305939593,"number":3761,"title":"Cors issue is coming after applying validation on routes headers option","user":{"login":"Rajat28goyal","id":10751749,"avatar_url":"https://avatars2.githubusercontent.com/u/10751749?v=4","gravatar_id":"","url":"https://api.github.com/users/Rajat28goyal","html_url":"https://github.com/Rajat28goyal","followers_url":"https://api.github.com/users/Rajat28goyal/followers","following_url":"https://api.github.com/users/Rajat28goyal/following{/other_user}","gists_url":"https://api.github.com/users/Rajat28goyal/gists{/gist_id}","starred_url":"https://api.github.com/users/Rajat28goyal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rajat28goyal/subscriptions","organizations_url":"https://api.github.com/users/Rajat28goyal/orgs","repos_url":"https://api.github.com/users/Rajat28goyal/repos","events_url":"https://api.github.com/users/Rajat28goyal/events{/privacy}","received_events_url":"https://api.github.com/users/Rajat28goyal/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-16T14:03:24Z","updated_at":"2018-03-16T14:03:24Z","closed_at":null,"author_association":"NONE","body":"If I apply validation on routes headers after allowing cors : true then it is giving an issue of cors in chrome console that no \"Access-control-allow-origin\" is allowed in headers.\r\n\r\nRoute -\r\n\r\nexports.logout = {\r\n    method: 'PUT',\r\n    path: '/logout',\r\n    config: {\r\n        description: 'logout',\r\n        auth: {\r\n            scope: CONSTANTS.SCOPE.ADMIN\r\n        },\r\n        tags: ['api', 'admin'],\r\n        handler: (request, h)=> {\r\n            return Controller.lLogout(request.auth.credentials.authData, h)\r\n                .then(response => {\r\n                    return UniversalFunc.sendSuccess(SUCCESS.LOGOUT,response, h);\r\n                })\r\n                .catch(error => {\r\n                    return UniversalFunc.sendError(error, h);\r\n                });\r\n        },\r\n        validate: {\r\n            headers: Joi.object().keys({authorization : Joi.string().required()}),\r\n            failAction: UniversalFunc.failActionFunction\r\n        }\r\n    }\r\n};\r\n\r\nIf I comment headers then all is working fine. \r\n\r\nWhat can be issue?\r\n\r\n* *node version*: - 8.9.4\r\n* *hapi version*: - 17.2.0\r\n* *os*: - MAC \r\n"}}
{"actor":{"display_login":"Rajat28goyal"}}