mirror of
https://github.com/discourse/discourse.git
synced 2025-01-21 21:55:16 +08:00
FIX: Always use the current session token in uppy (#23812)
…rather than the value at the time when uppy is initialized. Future TODO: extract csrf-fetching logic from ajax helper to Session service.
This commit is contained in:
parent
057c2012f0
commit
2c490773f1
|
@ -544,9 +544,9 @@ export default Mixin.create(ExtendableUploader, UppyS3Multipart, {
|
|||
_useXHRUploads() {
|
||||
this._uppyInstance.use(XHRUpload, {
|
||||
endpoint: getURL(`/uploads.json?client_id=${this.messageBus.clientId}`),
|
||||
headers: {
|
||||
headers: () => ({
|
||||
"X-CSRF-Token": this.session.csrfToken,
|
||||
},
|
||||
}),
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -350,9 +350,9 @@ export default Mixin.create(UppyS3Multipart, ExtendableUploader, {
|
|||
_useXHRUploads() {
|
||||
this._uppyInstance.use(XHRUpload, {
|
||||
endpoint: this._xhrUploadUrl(),
|
||||
headers: {
|
||||
headers: () => ({
|
||||
"X-CSRF-Token": this.session.csrfToken,
|
||||
},
|
||||
}),
|
||||
});
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user