froala / angular-froala

Angular.js bindings for Froala WYSIWYG HTML Rich Text Editor.
https://froala.com/wysiwyg-editor
MIT License
306 stars 123 forks source link

requestWithCredentials not using origin header #129

Closed nick-berry closed 7 years ago

nick-berry commented 7 years ago

Not sure if I'm misunderstanding how the "requestWithCredentials" option works but I'm having a bit of trouble. When uploading an image, the initial POST sends my cookie and an origin header. The subsequent request to get the image data to insert into the WYSIWYG contains the cookie, but not the origin header. The authorization built into the backend I am using requires the origin header for authorization. Attempted to set it via the "requestHeaders" option, but since it is an unsafe header I am unable to monkeypatch. Are there any known workarounds for such a scenario? Thanks.

nick-berry commented 7 years ago

Looks like the second request is made by the browser (in the image src attribute) and isn't made by a jQuery XMLHttpRequest in the tool like I thought. Closing this one.

elhendawy commented 6 years ago

Hi, I am facing the same issue, did you come up with a workaround. Thanks