mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-24 03:55:49 +08: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:
@@ -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'});
|
||||
|
||||
Reference in New Issue
Block a user