mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-20 00:10:26 +00:00
fix($http): add utf-8 to default Content-Type header (post/put)
This fixes special characters issue with MongoLab. https://groups.google.com/d/topic/angular/1T6h7bfZ7Rs/discussion
This commit is contained in:
parent
c3a41ff9fe
commit
10f80d7d29
2 changed files with 4 additions and 4 deletions
|
|
@ -111,8 +111,8 @@ function $HttpProvider() {
|
|||
'Accept': 'application/json, text/plain, */*',
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
},
|
||||
post: {'Content-Type': 'application/json'},
|
||||
put: {'Content-Type': 'application/json'}
|
||||
post: {'Content-Type': 'application/json;charset=utf-8'},
|
||||
put: {'Content-Type': 'application/json;charset=utf-8'}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -384,7 +384,7 @@ describe('$http', function() {
|
|||
$httpBackend.expect('POST', '/url', 'messageBody', function(headers) {
|
||||
return headers['Accept'] == 'application/json, text/plain, */*' &&
|
||||
headers['X-Requested-With'] == 'XMLHttpRequest' &&
|
||||
headers['Content-Type'] == 'application/json';
|
||||
headers['Content-Type'] == 'application/json;charset=utf-8';
|
||||
}).respond('');
|
||||
|
||||
$http({url: '/url', method: 'POST', headers: {}, data: 'messageBody'});
|
||||
|
|
@ -396,7 +396,7 @@ describe('$http', function() {
|
|||
$httpBackend.expect('PUT', '/url', 'messageBody', function(headers) {
|
||||
return headers['Accept'] == 'application/json, text/plain, */*' &&
|
||||
headers['X-Requested-With'] == 'XMLHttpRequest' &&
|
||||
headers['Content-Type'] == 'application/json';
|
||||
headers['Content-Type'] == 'application/json;charset=utf-8';
|
||||
}).respond('');
|
||||
|
||||
$http({url: '/url', method: 'PUT', headers: {}, data: 'messageBody'});
|
||||
|
|
|
|||
Loading…
Reference in a new issue