{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/27828","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/27828/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/27828/comments","events_url":"https://api.github.com/repos/angular/angular/issues/27828/events","html_url":"https://github.com/angular/angular/issues/27828","id":394051177,"node_id":"MDU6SXNzdWUzOTQwNTExNzc=","number":27828,"title":"Docs unclear on withCredentials following RequestOptions deprecation","user":{"login":"antgel","id":295571,"node_id":"MDQ6VXNlcjI5NTU3MQ==","avatar_url":"https://avatars2.githubusercontent.com/u/295571?v=4","gravatar_id":"","url":"https://api.github.com/users/antgel","html_url":"https://github.com/antgel","followers_url":"https://api.github.com/users/antgel/followers","following_url":"https://api.github.com/users/antgel/following{/other_user}","gists_url":"https://api.github.com/users/antgel/gists{/gist_id}","starred_url":"https://api.github.com/users/antgel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antgel/subscriptions","organizations_url":"https://api.github.com/users/antgel/orgs","repos_url":"https://api.github.com/users/antgel/repos","events_url":"https://api.github.com/users/antgel/events{/privacy}","received_events_url":"https://api.github.com/users/antgel/received_events","type":"User","site_admin":false},"labels":[{"id":644231098,"node_id":"MDU6TGFiZWw2NDQyMzEwOTg=","url":"https://api.github.com/repos/angular/angular/labels/comp:%20common/http","name":"comp: common/http","color":"c5def5","default":false},{"id":175085143,"node_id":"MDU6TGFiZWwxNzUwODUxNDM=","url":"https://api.github.com/repos/angular/angular/labels/comp:%20docs","name":"comp: docs","color":"c7def8","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/angular/angular/milestones/83","html_url":"https://github.com/angular/angular/milestone/83","labels_url":"https://api.github.com/repos/angular/angular/milestones/83/labels","id":3143880,"node_id":"MDk6TWlsZXN0b25lMzE0Mzg4MA==","number":83,"title":"needsTriage","description":"Milestone for all issues that haven't been triaged yet","creator":{"login":"ocombe","id":265378,"node_id":"MDQ6VXNlcjI2NTM3OA==","avatar_url":"https://avatars0.githubusercontent.com/u/265378?v=4","gravatar_id":"","url":"https://api.github.com/users/ocombe","html_url":"https://github.com/ocombe","followers_url":"https://api.github.com/users/ocombe/followers","following_url":"https://api.github.com/users/ocombe/following{/other_user}","gists_url":"https://api.github.com/users/ocombe/gists{/gist_id}","starred_url":"https://api.github.com/users/ocombe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ocombe/subscriptions","organizations_url":"https://api.github.com/users/ocombe/orgs","repos_url":"https://api.github.com/users/ocombe/repos","events_url":"https://api.github.com/users/ocombe/events{/privacy}","received_events_url":"https://api.github.com/users/ocombe/received_events","type":"User","site_admin":false},"open_issues":195,"closed_issues":1170,"state":"open","created_at":"2018-02-26T14:22:18Z","updated_at":"2018-12-26T16:26:11Z","due_on":null,"closed_at":null},"comments":12,"created_at":"2018-12-25T21:45:24Z","updated_at":"2018-12-26T16:53:36Z","closed_at":"2018-12-26T16:26:11Z","author_association":"NONE","body":"### Description\r\n\r\nI have a [problem](https://stackoverflow.com/questions/53925631/angular-cors-put-missing-authorization-header-after-options-preflight) with my Authorization header not being sent. I've been reading as much documentation as I can find, and [MDN's take](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials) states that:\r\n\r\n> For a CORS request with credentials, in order for browsers to expose the response to frontend JavaScript code, both the server (using the Access-Control-Allow-Credentials header) and the client (by setting the credentials mode for the XHR, Fetch, or Ajax request) must indicate that they’re opting in to including credentials.\r\n\r\nSo, how do I \"set the credentials mode\" for my XHR PUT request from Angular, if `withCredentials: true` is deprecated?\r\n\r\n### What's the affected URL?**\r\n\r\nhttps://angular.io/api/http/RequestOptions (deprecated), pointing to https://angular.io/guide/http which is lovely and shiny but doesn't mention anything about how to set the credentials mode.\r\n"},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/449993070","html_url":"https://github.com/angular/angular/issues/27828#issuecomment-449993070","issue_url":"https://api.github.com/repos/angular/angular/issues/27828","id":449993070,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0OTk5MzA3MA==","user":{"login":"trotyl","id":6059170,"node_id":"MDQ6VXNlcjYwNTkxNzA=","avatar_url":"https://avatars0.githubusercontent.com/u/6059170?v=4","gravatar_id":"","url":"https://api.github.com/users/trotyl","html_url":"https://github.com/trotyl","followers_url":"https://api.github.com/users/trotyl/followers","following_url":"https://api.github.com/users/trotyl/following{/other_user}","gists_url":"https://api.github.com/users/trotyl/gists{/gist_id}","starred_url":"https://api.github.com/users/trotyl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trotyl/subscriptions","organizations_url":"https://api.github.com/users/trotyl/orgs","repos_url":"https://api.github.com/users/trotyl/repos","events_url":"https://api.github.com/users/trotyl/events{/privacy}","received_events_url":"https://api.github.com/users/trotyl/received_events","type":"User","site_admin":false},"created_at":"2018-12-26T16:53:36Z","updated_at":"2018-12-26T16:53:36Z","author_association":"CONTRIBUTOR","body":"Sorry for anything sounds to be aggressive. I can provide some details (in different wording) here.\r\n\r\n> I have a problem with my Authorization header not being sent.\r\n\r\nGiven what you posted in the StackOverflow:\r\n\r\n```typescript\r\nconst headers = new HttpHeaders();                                                                                                                                                  \r\nheaders.set('Authorization', 'basic ' + btoa(environment.eventUsername + ':' + environment.eventPassword));                                                                         \r\nheaders.set('Content-Type', 'application/json');\r\n```\r\n\r\nThis is wrong as `HttpHeaders` immutable, you'll end up sending an empty `HttpHeaders` object, this isn't related to `Authorization`.\r\n\r\n> So, how do I \"set the credentials mode\" for my XHR PUT request from Angular, if withCredentials: true is deprecated?\r\n\r\n`withCredentials` is not deprecated, but `@angular/http` package is, I'd suggest change it for others to understand what's the point for this issue.\r\n\r\n> https://angular.io/api/http/RequestOptions (deprecated), pointing to https://angular.io/guide/http which is lovely and shiny but doesn't mention anything about how to set the credentials mode.\r\n\r\n`RequestOptions` also wasn't being linked in current doc, if any article or forum did, I'd suggest leave a reply for updating the solution.\r\n\r\nThe request for adding `withCredentials` in HTTP guide is valid, feel free to reopen, but please make the request clear like:\r\n\r\n> Adding an example with `withCredentials` usage in the Http Guide.\r\n\r\n---\r\n\r\nMerry Christmas"}}
{"actor":{"display_login":"trotyl"}}