From 5cb671259593950565b2856a7f704ef819289ee2 Mon Sep 17 00:00:00 2001 From: bjzhouqili Date: Fri, 10 Nov 2023 15:11:51 +0800 Subject: [PATCH] add xhr.withCredentials support. --- src/index.js | 1 + src/uploader.js | 1 + 2 files changed, 2 insertions(+) diff --git a/src/index.js b/src/index.js index ff00b214..e31ec558 100644 --- a/src/index.js +++ b/src/index.js @@ -54,6 +54,7 @@ import { IconAddBorder, IconStretch, IconAddBackground, IconPicture } from '@cod * @property {object} endpoints - upload endpoints * @property {string} endpoints.byFile - upload by file * @property {string} endpoints.byUrl - upload by URL + * @property {boolean} withCredentials - XMLHttpRequest's withCredentials option * @property {string} field - field name for uploaded image * @property {string} types - available mime-types * @property {string} captionPlaceholder - placeholder for Caption field diff --git a/src/uploader.js b/src/uploader.js index bfa6e2a5..bc9ea0d1 100644 --- a/src/uploader.js +++ b/src/uploader.js @@ -63,6 +63,7 @@ export default class Uploader { data: this.config.additionalRequestData, accept: this.config.types, headers: this.config.additionalRequestHeaders, + withCredentials: this.config.withCredentials, beforeSend: (files) => { preparePreview(files[0]); },