Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14751639
D19944.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
893 B
Referenced Files
None
Subscribers
None
D19944.id.diff
View Options
diff --git a/src/applications/conduit/controller/PhabricatorConduitAPIController.php b/src/applications/conduit/controller/PhabricatorConduitAPIController.php
--- a/src/applications/conduit/controller/PhabricatorConduitAPIController.php
+++ b/src/applications/conduit/controller/PhabricatorConduitAPIController.php
@@ -605,6 +605,15 @@
AphrontRequest $request,
$method) {
+ $content_type = $request->getHTTPHeader('Content-Type');
+
+ if ($content_type == 'application/json') {
+ throw new Exception(
+ pht('Use form-encoded data to submit parameters to Conduit endpoints. '.
+ 'Sending a JSON-encoded body and setting \'Content-Type\': '.
+ '\'application/json\' is not currently supported.'));
+ }
+
// Look for parameters from the Conduit API Console, which are encoded
// as HTTP POST parameters in an array, e.g.:
//
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jan 22, 12:38 PM (4 h, 36 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7033118
Default Alt Text
D19944.id.diff (893 B)
Attached To
Mode
D19944: Raise warning when accidentally submitting Conduit parameters as a JSON-encoded body
Attached
Detach File
Event Timeline
Log In to Comment