From: Aaron Parecki Date: Wed, 22 Mar 2017 18:47:13 +0000 (-0700) Subject: Add additional check to prevent sending direct uploads with JSON requests X-Git-Tag: v0.4.0~7 X-Git-Url: https://git.cweiske.de/shpub.git/commitdiff_plain/83fccd040efe517911486cfc2a925087e1c1cea2 Add additional check to prevent sending direct uploads with JSON requests --- 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 ) {