Skip to content

Commit

Permalink
Merge pull request #183 from ielcoro/FixDefaultHeaders
Browse files Browse the repository at this point in the history
Fix default headers (#105, #168)
  • Loading branch information
ielcoro authored Nov 15, 2017
2 parents f1e3514 + 989e3fa commit e6008c1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/auth-fetch-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ export class FetchConfig {
configure() {
this.httpClient.configure(httpConfig => {
httpConfig
.withDefaults({
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
}
})
.withInterceptor(this.auth.tokenInterceptor);
});
}
Expand Down
8 changes: 8 additions & 0 deletions src/auth-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ export class AuthService {

return this.http.fetch(signupUrl, {
method: 'post',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: json(content)
})
.then(status)
Expand Down Expand Up @@ -127,6 +131,10 @@ export class AuthService {
} else if (this.config.unlinkMethod === 'post') {
return this.http.fetch(unlinkUrl, {
method: 'post',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: json(provider)
}).then(status)
.then(response => {
Expand Down
4 changes: 4 additions & 0 deletions src/oAuth1.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ export class OAuth1 {

return this.http.fetch(exchangeForTokenUrl, {
method: 'post',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: json(data),
credentials: credentials
}).then(status);
Expand Down
4 changes: 4 additions & 0 deletions src/oAuth2.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ export class OAuth2 {

return this.http.fetch(exchangeForTokenUrl, {
method: 'post',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: json(data),
credentials: credentials
}).then(status);
Expand Down

0 comments on commit e6008c1

Please sign in to comment.