From 83fccd040efe517911486cfc2a925087e1c1cea2 Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Wed, 22 Mar 2017 11:47:13 -0700 Subject: [PATCH] Add additional check to prevent sending direct uploads with JSON requests --- src/shpub/Request.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/shpub/Request.php b/src/shpub/Request.php index 8262863..0713872 100644 --- a/src/shpub/Request.php +++ b/src/shpub/Request.php @@ -148,6 +148,12 @@ class Request */ public function addUpload($fieldName, $fileNames) { + if ($this->directUpload && $this->sendAsJson) { + throw new \Exception( + 'Cannot do direct upload with JSON requests' + ); + } + if ($this->host->endpoints->media === null || $this->directUpload ) { -- 2.30.2