javascript - AngularJS $resource GET works in Chrome but gives a 401 in Firefox -


so i've got basic custom in angular using $resource

angular.module('myapp')   .factory('myservice', function($resource){     return $resrouce('some url',     {},     {        list: {method:'get', params:{}}     });   }); 

i use this

myservice.list().$promise.then(function(data){    //do }); 

when use in chrome (33) works. in firefox (10.0.2) a

401 unauthorized 

if go url directly within firefox data.

the service , page hosted on different boxes. wondered if it's got cross site protection or something? thoughts?

edit: i've tried enabling cors per this answer again no help.

edit2: 401 response has no body. headers pretty basic...

http/1.1: 401 unauthorized server: apache-coyote/1.1 pragma: no-cache cache-control: no-cache expires: thu, 01 jan 1970 00:00:00 utc content-length: 1174 date: tue, 14 jul 2015 08:52:16 gmt 

problem solved. needed add

$httpprovider.defaults.withcredentials = true; 

looks cors error


Comments