{"action":"created","issue":{"url":"https://api.github.com/repos/IGNF/geoportal-wfs-client/issues/2","repository_url":"https://api.github.com/repos/IGNF/geoportal-wfs-client","labels_url":"https://api.github.com/repos/IGNF/geoportal-wfs-client/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/IGNF/geoportal-wfs-client/issues/2/comments","events_url":"https://api.github.com/repos/IGNF/geoportal-wfs-client/issues/2/events","html_url":"https://github.com/IGNF/geoportal-wfs-client/issues/2","id":294430676,"number":2,"title":"Add ssl option","user":{"login":"cyrilchapon","id":10728426,"avatar_url":"https://avatars1.githubusercontent.com/u/10728426?v=4","gravatar_id":"","url":"https://api.github.com/users/cyrilchapon","html_url":"https://github.com/cyrilchapon","followers_url":"https://api.github.com/users/cyrilchapon/followers","following_url":"https://api.github.com/users/cyrilchapon/following{/other_user}","gists_url":"https://api.github.com/users/cyrilchapon/gists{/gist_id}","starred_url":"https://api.github.com/users/cyrilchapon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyrilchapon/subscriptions","organizations_url":"https://api.github.com/users/cyrilchapon/orgs","repos_url":"https://api.github.com/users/cyrilchapon/repos","events_url":"https://api.github.com/users/cyrilchapon/events{/privacy}","received_events_url":"https://api.github.com/users/cyrilchapon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-05T15:22:41Z","updated_at":"2018-02-05T18:29:37Z","closed_at":null,"author_association":"NONE","body":"Just like in https://github.com/IGNF/geoportal-access-lib, we need an ssl option as browsers block `http` ajax calls from `https` context, this make the lib unusable in most client side contexts.\r\n\r\nTemporary workaround :\r\n\r\n**ES6**\r\n\r\n```\r\nimport GpWfsClient from 'geoportal-wfs-client'\r\nimport { omit, isUndefined } from 'lodash'\r\n\r\nclass ImprovedGpWfsClient extends GpWfsClient {\r\n  constructor(apiKey, options) {\r\n    super(apiKey, omit(options, 'ssl'))\r\n\r\n    this.ssl = options ? (isUndefined(options.ssl) ? true : !!options.ssl) : true\r\n    this.getUrl = this.getUrl.bind(this)\r\n  }\r\n\r\n  getUrl() {\r\n    return `http${this.ssl ? 's' : ''}://wxs.ign.fr/${this.apiKey}/geoportail/wfs`\r\n  }\r\n}\r\n\r\nexport default ImprovedGpWfsClient\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/IGNF/geoportal-wfs-client/issues/comments/363176135","html_url":"https://github.com/IGNF/geoportal-wfs-client/issues/2#issuecomment-363176135","issue_url":"https://api.github.com/repos/IGNF/geoportal-wfs-client/issues/2","id":363176135,"user":{"login":"mborne","id":1783064,"avatar_url":"https://avatars0.githubusercontent.com/u/1783064?v=4","gravatar_id":"","url":"https://api.github.com/users/mborne","html_url":"https://github.com/mborne","followers_url":"https://api.github.com/users/mborne/followers","following_url":"https://api.github.com/users/mborne/following{/other_user}","gists_url":"https://api.github.com/users/mborne/gists{/gist_id}","starred_url":"https://api.github.com/users/mborne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mborne/subscriptions","organizations_url":"https://api.github.com/users/mborne/orgs","repos_url":"https://api.github.com/users/mborne/repos","events_url":"https://api.github.com/users/mborne/events{/privacy}","received_events_url":"https://api.github.com/users/mborne/received_events","type":"User","site_admin":false},"created_at":"2018-02-05T18:29:37Z","updated_at":"2018-02-05T18:29:37Z","author_association":"CONTRIBUTOR","body":"Thanks for you're feedback. Any objection if I had an option `url` with the following default value  : \r\n\r\nhttps://wxs.ign.fr/{apiKey}/geoportail/wfs\r\n\r\n?\r\n\r\nThis should fix you're problem and allow the reuse of the client for different WFS servers (this one in particular : https://github.com/IGNF/geoportail-urbanisme-dev#flux-wfs )\r\n\r\n\r\n"}}
{"actor":{"display_login":"mborne"}}