{"action":"opened","issue":{"url":"https://api.github.com/repos/dingo/api/issues/359","labels_url":"https://api.github.com/repos/dingo/api/issues/359/labels{/name}","comments_url":"https://api.github.com/repos/dingo/api/issues/359/comments","events_url":"https://api.github.com/repos/dingo/api/issues/359/events","html_url":"https://github.com/dingo/api/issues/359","id":56802058,"number":359,"title":"Endpoints unreachable from web browser","user":{"login":"sfolador","id":36632,"avatar_url":"https://avatars.githubusercontent.com/u/36632?v=3","gravatar_id":"","url":"https://api.github.com/users/sfolador","html_url":"https://github.com/sfolador","followers_url":"https://api.github.com/users/sfolador/followers","following_url":"https://api.github.com/users/sfolador/following{/other_user}","gists_url":"https://api.github.com/users/sfolador/gists{/gist_id}","starred_url":"https://api.github.com/users/sfolador/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sfolador/subscriptions","organizations_url":"https://api.github.com/users/sfolador/orgs","repos_url":"https://api.github.com/users/sfolador/repos","events_url":"https://api.github.com/users/sfolador/events{/privacy}","received_events_url":"https://api.github.com/users/sfolador/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-06T11:40:24Z","updated_at":"2015-02-06T11:40:24Z","closed_at":null,"body":"Hi, \r\nEverything is working out of the box if we call the api endpoints using the \"accept header\". So, using curl we can call endpoints with v1 and v2. \r\n**In the configuration, the  `'strict'`  option is set to FALSE.**\r\nHow can we reach those endpoints from a web browser (i.e.: http://local.testingapi/v1/endpoint )?\r\n\r\nOur routes:\r\n\r\n\r\n```\r\n\r\nRoute::api(\r\n   array(\"version\" => \"v1\",\"prefix\" => \"v1\"),\r\n    function () {\r\n  Route::get(\r\n            'endpoint',\r\n            function () {\r\n                echo \"api 1\";\r\n            }\r\n        );    \r\n}\r\n);\r\n\r\nRoute::api(\r\n    array(\"version\" => \"v2\",\"prefix\" => \"v2\"),\r\n    function () {\r\n        Route::get(\r\n            'endpoint',\r\n            function () {\r\n                echo \"api 2\";\r\n            }\r\n        );\r\n\r\n    }\r\n);\r\n\r\n```\r\n\r\nIf we try to reach `http://local.testingapi/v2/api` it doesn't work and we get a NotFoundHttpException.\r\n\r\nWe tried to add this to `filters.php`:\r\n\r\n```\r\nApp::before(\r\n    function ($request) {\r\n        $path = explode('/', Request::path());\r\n        if (in_array($path[0], Config::get('app.api_versions'))) {\r\n            $request->headers->set('Accept', 'application/vnd.ourvendorname.' . $path[0] . '+json');\r\n        }\r\n    }\r\n);\r\n```\r\n\r\nthe problem is that if we call http://local.testingapi/v2/endpoint it doesn't work and we get an exception:\r\n\r\n`BadRequestHttpException('The requested API version is invalid.');`\r\n\r\n\r\nLong story short: \r\n\r\n- using the browser we can access only the default version of the api\r\n- changing the default version of the api to v2 allows us to reach http://local.testingapi/v2/endpoint\r\n- adding the before filter allows us to get a different exception\r\n\r\nDo you have any advice?\r\n\r\n\r\n\r\n"}}