Skip to content

Commit

Permalink
Merge pull request #81 from CPS-IT/bugfix/enforcing-http-methods
Browse files Browse the repository at this point in the history
[TASK] Enforce HTTP methods in module controller
  • Loading branch information
eliashaeussler authored Jan 23, 2025
2 parents 028fb1c + 9f216e7 commit 5254a0b
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 47 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ jobs:
- name: Start MySQL
run: sudo /etc/init.d/mysql start

# Configure TYPO3 ELTS
- name: Add ELTS repository
run: |
composer config repositories.typo3-elts composer https://elts.typo3.com
composer config http-basic.elts.typo3.com ${{ secrets.TYPO3_ELTS_USERNAME }} ${{ secrets.TYPO3_ELTS_PASSWORD }}
if: ${{ matrix.typo3-version == '11.5' }}

# Install dependencies
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
Expand Down
3 changes: 3 additions & 0 deletions Classes/Controller/MailqueueModuleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
final class MailqueueModuleController
{
use Traits\TranslatableTrait;
use Core\Http\AllowedMethodsTrait;

private readonly Core\Information\Typo3Version $typo3Version;

Expand All @@ -59,6 +60,8 @@ public function __construct(

public function __invoke(Message\ServerRequestInterface $request): Message\ResponseInterface
{
$this->assertAllowedHttpMethod($request, 'GET', 'POST');

$template = $this->moduleTemplateFactory->create($request);
$transport = $this->mailer->getTransport();
$page = $this->resolvePageIdFromRequest($request);
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
"symfony/console": "^5.4 || ^6.4 || ^7.0",
"symfony/mailer": "^5.4 || ^6.4 || ^7.0",
"symfony/mime": "^5.4 || ^6.4 || ^7.0",
"typo3/cms-backend": "~11.5.0 || ~12.4.0 || ~13.4.0",
"typo3/cms-core": "~11.5.0 || ~12.4.0 || ~13.4.0",
"typo3/cms-fluid": "~11.5.0 || ~12.4.0 || ~13.4.0",
"typo3/cms-backend": "~11.5.42 || ~12.4.25 || ~13.4.3",
"typo3/cms-core": "~11.5.42 || ~12.4.25 || ~13.4.3",
"typo3/cms-fluid": "~11.5.42 || ~12.4.25 || ~13.4.3",
"typo3fluid/fluid": "^2.15 || ^4.0"
},
"require-dev": {
Expand All @@ -35,7 +35,7 @@
"phpunit/phpcov": "^9.0 || ^10.0",
"saschaegerer/phpstan-typo3": "^1.10",
"ssch/typo3-rector": "^2.0",
"typo3/cms-lowlevel": "~11.5.0 || ~12.4.0 || ~13.4.0",
"typo3/cms-lowlevel": "~11.5.42 || ~12.4.25 || ~13.4.3",
"typo3/coding-standards": "^0.7.0 || ^0.8.0",
"typo3/testing-framework": "^7.0.2 || ^8.0.9 || ^9.0.1"
},
Expand Down
84 changes: 42 additions & 42 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
'author_company' => 'coding. powerful. systems. CPS GmbH',
'constraints' => [
'depends' => [
'typo3' => '11.5.0-13.4.99',
'typo3' => '11.5.42-13.4.99',
'php' => '8.1.0-8.4.99',
],
],
Expand Down

0 comments on commit 5254a0b

Please sign in to comment.