{"action":"created","issue":{"url":"https://api.github.com/repos/zestedesavoir/zds-site/issues/2666","labels_url":"https://api.github.com/repos/zestedesavoir/zds-site/issues/2666/labels{/name}","comments_url":"https://api.github.com/repos/zestedesavoir/zds-site/issues/2666/comments","events_url":"https://api.github.com/repos/zestedesavoir/zds-site/issues/2666/events","html_url":"https://github.com/zestedesavoir/zds-site/issues/2666","id":75546605,"number":2666,"title":"Problème avec CORS ","user":{"login":"firm1","id":6066015,"avatar_url":"https://avatars.githubusercontent.com/u/6066015?v=3","gravatar_id":"","url":"https://api.github.com/users/firm1","html_url":"https://github.com/firm1","followers_url":"https://api.github.com/users/firm1/followers","following_url":"https://api.github.com/users/firm1/following{/other_user}","gists_url":"https://api.github.com/users/firm1/gists{/gist_id}","starred_url":"https://api.github.com/users/firm1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/firm1/subscriptions","organizations_url":"https://api.github.com/users/firm1/orgs","repos_url":"https://api.github.com/users/firm1/repos","events_url":"https://api.github.com/users/firm1/events{/privacy}","received_events_url":"https://api.github.com/users/firm1/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/zestedesavoir/zds-site/labels/API","name":"API","color":"eb6420"},{"url":"https://api.github.com/repos/zestedesavoir/zds-site/labels/BUG","name":"BUG","color":"e11d21"},{"url":"https://api.github.com/repos/zestedesavoir/zds-site/labels/Infra","name":"Infra","color":"444444"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-05-12T10:07:19Z","updated_at":"2015-12-14T14:47:56Z","closed_at":null,"body":"> Hello,\r\n> \r\n> J'ai essayé d'utiliser l'API, mais j'ai un problème.\r\n> \r\n> Ça, sa marche :\r\n> \r\n>     $ curl -i https://zestedesavoir.com/api/membres/\r\n> \r\n> ```\r\n> HTTP/1.1 200 OK\r\n> Server: nginx\r\n> Date: Mon, 11 May 2015 19:05:14 GMT\r\n> Content-Type: application/json\r\n> Transfer-Encoding: chunked\r\n> Connection: keep-alive\r\n> Vary: Accept-Encoding\r\n> ETag: \"d8f9437e4f88b4e6e2ad0a6d770d970bfdd5bbbc689cc3b3390759d06d4f105a\"\r\n> Vary: Accept, Cookie\r\n> Allow: GET, POST, HEAD, OPTIONS\r\n> P3P: CP=\"ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV\"\r\n> Strict-Transport-Security: max-age=500\r\n> Access-Control-Allow-Origin: *\r\n> X-Clacks-Overhead: GNU Terry Pratchett\r\n> \r\n> {\"count\":2480,\"next\":\"http://zestedesavoir.com/api/membres/?page=2\",\"previous\":null,\"results\":[Tableau long ...]}\r\n> ```\r\n> \r\n> Mais quand je le met dans une page web :\r\n> \r\n>     $.get(\"https://zestedesavoir.com/api/membres/\"); // jQuery évidemment ^^.\r\n> \r\n> J'obtient ça :\r\n> \r\n> ![cors-1](http://zestedesavoir.com/media/galleries/1775/b3bbb5db-ee6e-46fc-934f-0bbedbd2c568.png.960x960_q85.jpg)\r\n> \r\n> ![cors-2](http://zestedesavoir.com/media/galleries/1775/4258b462-0c87-40b4-82a7-740d69bdd5d9.png.960x960_q85.jpg)\r\n> \r\n> Et j'ai aucune idée de l'origine de l'erreur.\r\n> \r\n> Quelqu'un sait pourquoi j'ai deux `Access-Control-Allow-Origin` dans la réponse ?\r\nSource:[Umbra](http://zestedesavoir.com/forums/sujet/3130/probleme-avec-cors/?page=1#p56412)\r\n\r\nLe fait que l'on retrouve l'url `127.0.0.1:8000` dans le message d'erreur me fait penser qu'on a ici un problème d'infra."},"comment":{"url":"https://api.github.com/repos/zestedesavoir/zds-site/issues/comments/164455541","html_url":"https://github.com/zestedesavoir/zds-site/issues/2666#issuecomment-164455541","issue_url":"https://api.github.com/repos/zestedesavoir/zds-site/issues/2666","id":164455541,"user":{"login":"firm1","id":6066015,"avatar_url":"https://avatars.githubusercontent.com/u/6066015?v=3","gravatar_id":"","url":"https://api.github.com/users/firm1","html_url":"https://github.com/firm1","followers_url":"https://api.github.com/users/firm1/followers","following_url":"https://api.github.com/users/firm1/following{/other_user}","gists_url":"https://api.github.com/users/firm1/gists{/gist_id}","starred_url":"https://api.github.com/users/firm1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/firm1/subscriptions","organizations_url":"https://api.github.com/users/firm1/orgs","repos_url":"https://api.github.com/users/firm1/repos","events_url":"https://api.github.com/users/firm1/events{/privacy}","received_events_url":"https://api.github.com/users/firm1/received_events","type":"User","site_admin":false},"created_at":"2015-12-14T14:47:56Z","updated_at":"2015-12-14T14:47:56Z","body":"[Le problème persiste](https://zestedesavoir.com/forums/sujet/4844/impossible-de-manipuler-lapi-de-zds-en-javascript/) et rend inutilisable l'api via du javascript pour faire une webapp externe au site."}}