From 58da57e56b08734d34d0ffeea622105fc8a601ee Mon Sep 17 00:00:00 2001 From: jywarren Date: Thu, 25 Aug 2016 19:06:50 -0400 Subject: [PATCH] xhrOptions options param to pass to bureaucracy --- readme.markdown | 5 ++++- src/prompts/prompt.js | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/readme.markdown b/readme.markdown index 0d76a93..87207da 100644 --- a/readme.markdown +++ b/readme.markdown @@ -212,9 +212,12 @@ If you wish to set up file uploads, _in addition to letting the user just paste // image field key, passed to bureaucracy, which defaults to 'uploads' fieldKey: 'uploads', - // optional additional form submission data, passed to bureaucracy + // optional additional form submission data, passed to `bureaucracy` formData: { description: 'A new image' }, + // optional options for `xhr` upload request, passed to `bureaucracy` + xhrOptions: { headers: {} }, + // optional text describing the kind of files that can be uploaded restriction: 'GIF, JPG, and PNG images', diff --git a/src/prompts/prompt.js b/src/prompts/prompt.js index 3c0a70e..c233baf 100644 --- a/src/prompts/prompt.js +++ b/src/prompts/prompt.js @@ -112,6 +112,7 @@ function prompt (options, done) { method: upload.method, formData: upload.formData, fieldKey: upload.fieldKey, + xhrOptions: upload.xhrOptions, endpoint: upload.url, validate: 'image' });