Skip to content

Issue with AngularJS 1.4 and transformRequest and uploading to S3 #814

@darkmavis1980

Description

@darkmavis1980

I have an issue today when I updated my project from Angular 1.3 to 1.4, and it's probably because now you can't modify the request header with transformRequest anymore (or at least according to this article).
Essentially before I was calling the upload function with these parameters:

        url: my-bucket-url,
        headers: {'Content-Type': file.type},
        method: 'POST',
        transformRequest: function (data, headersGetter) {
          // Headers change here
          var headers = headersGetter();
          delete headers.Authorization;
          return data;
        },
        fields: fieldsData,
        ...

As I had to remove the Authorization token from the header I had to transform my headers before sending the file to S3. But now I see that the Authorization is not getting removed from the headers.
Any idea how to fix it? Did anybody test ng-file-upload with Angular 1.4?

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