seneca-auth currently only returns a 401 for restricted requests that have a 'content-type' header which starts with 'application/json;'
I'd like to get a 401 response from GET requests sent by angular's $http service, but these don't include a content-type header (and it seems that the convention is to not include this header with GET requests in general).
seneca-auth currently only returns a 401 for restricted requests that have a 'content-type' header which starts with 'application/json;'
I'd like to get a 401 response from GET requests sent by angular's $http service, but these don't include a content-type header (and it seems that the convention is to not include this header with GET requests in general).
Headers can be manually specified for requests:
but angular actually strips out the content-type header if no data is included with the request see line 6633 :anguished:.
As a workaround, I'm using the longhand syntax for GET requests and including an empty data parameter:
or to achieve the same thing for all GET requests: