Skip to content

Commit de61c15

Browse files
author
roman
committed
MAGETWO-72048: Wrong file upload behavior
1 parent f4ec334 commit de61c15

File tree

2 files changed

+4
-2
lines changed
  • app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File
  • dev/tests/integration/testsuite/Magento/Downloadable/Controller/Adminhtml/Downloadable

2 files changed

+4
-2
lines changed

app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File/Upload.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
*/
66
namespace Magento\Downloadable\Controller\Adminhtml\Downloadable\File;
77

8-
use Magento\Framework\App\Action\HttpGetActionInterface;
8+
use Magento\Framework\App\Action\HttpPostActionInterface;
99
use Magento\Framework\Controller\ResultFactory;
1010

1111
/**
1212
* Class Upload
1313
*
1414
* @package Magento\Downloadable\Controller\Adminhtml\Downloadable\File
1515
*/
16-
class Upload extends \Magento\Downloadable\Controller\Adminhtml\Downloadable\File implements HttpGetActionInterface
16+
class Upload extends \Magento\Downloadable\Controller\Adminhtml\Downloadable\File implements HttpPostActionInterface
1717
{
1818
/**
1919
* @var \Magento\Downloadable\Model\Link

dev/tests/integration/testsuite/Magento/Downloadable/Controller/Adminhtml/Downloadable/FileTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public function testUploadAction()
3737
],
3838
];
3939

40+
$this->getRequest()->setMethod('POST');
4041
$this->dispatch('backend/admin/downloadable_file/upload/type/samples');
4142
$body = $this->getResponse()->getBody();
4243
$result = Bootstrap::getObjectManager()->get(Json::class)->unserialize($body);
@@ -64,6 +65,7 @@ public function testUploadProhibitedExtensions($fileName)
6465
],
6566
];
6667

68+
$this->getRequest()->setMethod('POST');
6769
$this->dispatch('backend/admin/downloadable_file/upload/type/samples');
6870
$body = $this->getResponse()->getBody();
6971
$result = Bootstrap::getObjectManager()->get(Json::class)->unserialize($body);

0 commit comments

Comments
 (0)