$ Http message not working in Safari

I am developing an AngularJS application and I have implemented a simple login API. The API gives me the answer in all browsers except Safari.

My login API call looks like this:

$http.post(config.login, {
        email: username,
        password: password
    })
    .then(function (response) {
            callback(response);
        },
        function (response) {
            callback(response);
        });

I get the following answer in Safari.

enter image description here

I am using Angular v1.4.8 Safari version 9.0 (11601.1.56)

Any clue about what's going wrong?

+4
source share
1 answer

It makes me crazy. First, I upload the angular.js file, then search for "xhr.setRequestHead". All the problems are here. I tried to put some magazines to see what was happening.

forEach(headers, function(value, key) {
    key = key.trim();// trim the key
    value = value.trim();// trim the value
    console.log("******************** key: " + key);
    console.log("******************** value: " + value);
    console.log('value: Basic vs ' + value+ ' equal: '+ (value==="Basic"));
    console.log('value.length: ' + value.length);
    if (isDefined(value)) {
         xhr.setRequestHeader(key, value);
    }
});

, angularjs "": "Basic" in. "Basic" 6 5. , key = key.trim() value = value.trim() .

, .

+3

Source: https://habr.com/ru/post/1621218/


All Articles