{"action":"created","issue":{"url":"https://api.github.com/repos/SpoonX/aurelia-api/issues/215","repository_url":"https://api.github.com/repos/SpoonX/aurelia-api","labels_url":"https://api.github.com/repos/SpoonX/aurelia-api/issues/215/labels{/name}","comments_url":"https://api.github.com/repos/SpoonX/aurelia-api/issues/215/comments","events_url":"https://api.github.com/repos/SpoonX/aurelia-api/issues/215/events","html_url":"https://github.com/SpoonX/aurelia-api/pull/215","id":326938617,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkwODY1MDY4","number":215,"title":"fix(config): transfer defaults from the endpoint client configuration…","user":{"login":"doktordirk","id":13430091,"node_id":"MDQ6VXNlcjEzNDMwMDkx","avatar_url":"https://avatars1.githubusercontent.com/u/13430091?v=4","gravatar_id":"","url":"https://api.github.com/users/doktordirk","html_url":"https://github.com/doktordirk","followers_url":"https://api.github.com/users/doktordirk/followers","following_url":"https://api.github.com/users/doktordirk/following{/other_user}","gists_url":"https://api.github.com/users/doktordirk/gists{/gist_id}","starred_url":"https://api.github.com/users/doktordirk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/doktordirk/subscriptions","organizations_url":"https://api.github.com/users/doktordirk/orgs","repos_url":"https://api.github.com/users/doktordirk/repos","events_url":"https://api.github.com/users/doktordirk/events{/privacy}","received_events_url":"https://api.github.com/users/doktordirk/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-28T08:17:07Z","updated_at":"2018-07-11T10:04:47Z","closed_at":"2018-05-28T08:17:19Z","author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/SpoonX/aurelia-api/pulls/215","html_url":"https://github.com/SpoonX/aurelia-api/pull/215","diff_url":"https://github.com/SpoonX/aurelia-api/pull/215.diff","patch_url":"https://github.com/SpoonX/aurelia-api/pull/215.patch"},"body":"… function to the endpoint defaults\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/spoonx/aurelia-api/215)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/SpoonX/aurelia-api/issues/comments/404115839","html_url":"https://github.com/SpoonX/aurelia-api/pull/215#issuecomment-404115839","issue_url":"https://api.github.com/repos/SpoonX/aurelia-api/issues/215","id":404115839,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDExNTgzOQ==","user":{"login":"soulhunter1987","id":2089893,"node_id":"MDQ6VXNlcjIwODk4OTM=","avatar_url":"https://avatars2.githubusercontent.com/u/2089893?v=4","gravatar_id":"","url":"https://api.github.com/users/soulhunter1987","html_url":"https://github.com/soulhunter1987","followers_url":"https://api.github.com/users/soulhunter1987/followers","following_url":"https://api.github.com/users/soulhunter1987/following{/other_user}","gists_url":"https://api.github.com/users/soulhunter1987/gists{/gist_id}","starred_url":"https://api.github.com/users/soulhunter1987/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soulhunter1987/subscriptions","organizations_url":"https://api.github.com/users/soulhunter1987/orgs","repos_url":"https://api.github.com/users/soulhunter1987/repos","events_url":"https://api.github.com/users/soulhunter1987/events{/privacy}","received_events_url":"https://api.github.com/users/soulhunter1987/received_events","type":"User","site_admin":false},"created_at":"2018-07-11T10:04:47Z","updated_at":"2018-07-11T10:04:47Z","author_association":"NONE","body":"Hi. This change breaks default behavior when there is no configuration (withDefaults) on endpoint client, because client defaults are an empty object, not null. When using this code from manual:\r\n```javascript\r\nexport function configure(aurelia) {\r\n  aurelia.use\r\n    .standardConfiguration()\r\n    .developmentLogging()\r\n\r\n    // Add this:\r\n    .plugin('aurelia-api', config => {\r\n      config.registerEndpoint('github', 'https://api.github.com/');\r\n    });\r\n\r\n  aurelia.start().then(a => a.setRoot());\r\n}\r\n```\r\nI get queries without Content-type: application/json and Accept: application/json being set, because they are discarded on this line:\r\n```javascript\r\n// transfer user defaults from http-client to endpoint\r\n+      if (typeof newClient.defaults === 'object' && newClient.defaults !== null) {\r\n+        this.endpoints[name].defaults = newClient.defaults;\r\n+      }\r\n```"}}
{"actor":{"display_login":"soulhunter1987"}}