vienthuong / shopware-php-sdk

A PHP SDK for Shopware 6 Admin API
MIT License
112 stars 44 forks source link

AdminActionService::execute should support upper case action string #40

Closed mschop closed 2 years ago

mschop commented 2 years ago

Calling the AdminActionService's action method with $method = 'POST' causes throwing \InvalidArgumentException

(new AdminActionService(...))->execute('POST', ...);

The allow list check should be made case insensitive.

Instead of:

if (!in_array($method, ['get', 'post', 'put', 'patch', 'delete'])) {

This:

if (!in_array(strtolower($method), ['get', 'post', 'put', 'patch', 'delete'])) {
vienthuong commented 2 years ago

I updated it in the lastest version, feel free to reopen ticket if you have any issue https://github.com/vienthuong/shopware-php-sdk/pull/44