mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 10:20:58 -06:00
SECURITY: Don't send CSRF token in query string
The token is already present in the headers thanks to the csrf-token initializer.
This commit is contained in:
parent
75f37ac16a
commit
d59746cdc1
@ -657,13 +657,10 @@ export default Ember.Component.extend({
|
||||
this._pasted = false;
|
||||
|
||||
const $element = $(this.element);
|
||||
const csrf = this.session.get("csrfToken");
|
||||
|
||||
$element.fileupload({
|
||||
url: Discourse.getURL(
|
||||
`/uploads.json?client_id=${
|
||||
this.messageBus.clientId
|
||||
}&authenticity_token=${encodeURIComponent(csrf)}`
|
||||
`/uploads.json?client_id=${this.messageBus.clientId}`
|
||||
),
|
||||
dataType: "json",
|
||||
pasteZone: $element
|
||||
|
@ -23,8 +23,6 @@ export default Ember.Mixin.create({
|
||||
getUrl(this.getWithDefault("uploadUrl", "/uploads")) +
|
||||
".json?client_id=" +
|
||||
(this.messageBus && this.messageBus.clientId) +
|
||||
"&authenticity_token=" +
|
||||
encodeURIComponent(Discourse.Session.currentProp("csrfToken")) +
|
||||
this.uploadUrlParams
|
||||
);
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user