Skip to content
This repository was archived by the owner on Apr 23, 2018. It is now read-only.
This repository was archived by the owner on Apr 23, 2018. It is now read-only.

Obsolete code since for angular 1.3+ #56

Description

@vitvad

Hi recently migrate angular framework in my project from 1.2.28 to 1.4.7
And found that since this commit angular/angular.js@7b6c1d0#diff-748e0a1e1a7db3458d5f95d59d7e16c9

angular changed their default response interceptor, now they require headers link

in upload code when you use force Iframe option,
https://github.com/leon/angular-upload/blob/master/angular-upload.js#L254
iframe doesn't has headers for you try to call interceptor with Array instead of function.

angular defaultHttpResponseTransform fall with Uncaught TypeError: headers is not a function(…)
and as soon as in upload you call all transformation in try{}catch(){} https://github.com/leon/angular-upload/blob/master/angular-upload.js#L215
you will never see this error, but you also never get proper JSON response from angular interceptor.

suggested fix:
change https://github.com/leon/angular-upload/blob/master/angular-upload.js#L252
to

var headers = function(){}; // not sure is there any sense return anything for iframe 

P.S. up to you if you want change anything. I guess people who use you library parse json response manually

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions