-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with AngularJS 1.4 and transformRequest and uploading to S3 #814
Comments
If you don't need the Authorization headers then don't add them to the request in first place. |
Unfortuantely it's not that easy, the Token is added to all the request as it's needed for authentication with the API, the only case where I don't need it is when I have to upload a file from the client directly to S3 |
Found a solution, not beautiful, but it works.
Again, not a beautiful solution, but at least now I have the upload on S3 back working on my project |
Better to replace transform request with just this
|
@danialfarid I suggest closing this. |
This helped me but I think referencing the repo at nukulb/s3-angular-file-upload is a bit confusing as It feels like its outdated. Maybe update README? |
Specifically that example uses the transformRequest technique for removing the Authorization header. |
Seems like more of an issue with your auth implementation than this library. I store my tokens elsewhere and set the auth header on the fly if the request url contains my API base url. Who knows what other services you may have issues with later? I doubt you want this transformRequest code in every single place you're hitting an endpoint other than your API. |
@paulwithap Good point on checking the base URL before adding the auth header. Thanks for the idea. |
@paulwithap All the calls to my API has to contain the token in the header, it would be silly to do a control every time in my opinion. |
The point was not how my app should work, but the simple fact that the transformRequest doesn't work anymore with AngularJS 1.4 onwards, that's it |
We are having an issue with angular transform request and ADDING a header. This is a deprecation since angular 1.2.x which we upgraded from. |
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:
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?
The text was updated successfully, but these errors were encountered: