From cc71fc6109efcb85f417411c6ed437710f1cbc19 Mon Sep 17 00:00:00 2001 From: jekuaitk Date: Wed, 17 Apr 2024 14:12:30 +0200 Subject: [PATCH 1/4] Fixed content-type header --- CHANGELOG.md | 4 ++++ src/Helper/FasitHelper.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd1405e..cc465f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ about writing changes to this log. ## [Unreleased] +## [1.0.2] 2024-04-17 + +- Fixed `Content-Type` header. + ## [1.0.1] 2024-04-04 - Fixed queue install configuration. diff --git a/src/Helper/FasitHelper.php b/src/Helper/FasitHelper.php index 40c4d5b..499888f 100644 --- a/src/Helper/FasitHelper.php +++ b/src/Helper/FasitHelper.php @@ -317,7 +317,7 @@ private function uploadFile(string $originalFilename, string $tempFilename): arr try { $options = [ 'headers' => [ - 'Content-Type' => 'multipart/form-data', + 'Content-Type' => 'application/pdf', 'X-Filename' => $originalFilename, 'X-Title' => pathinfo($originalFilename, PATHINFO_FILENAME), ], From a40d1ff8f4b63dfd499f7676e0ca806d2f9e4287 Mon Sep 17 00:00:00 2001 From: jekuaitk Date: Mon, 22 Apr 2024 08:55:08 +0200 Subject: [PATCH 2/4] Updated CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc465f5..9cceb59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ about writing changes to this log. ## [Unreleased] -## [1.0.2] 2024-04-17 +## [1.0.2] 2024-04-22 - Fixed `Content-Type` header. From d3c12fc918770b69e9ff9b529fe9dedae014ac85 Mon Sep 17 00:00:00 2001 From: jekuaitk Date: Mon, 22 Apr 2024 09:23:57 +0200 Subject: [PATCH 3/4] Used correct request option --- src/Helper/FasitHelper.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/Helper/FasitHelper.php b/src/Helper/FasitHelper.php index 499888f..2003e45 100644 --- a/src/Helper/FasitHelper.php +++ b/src/Helper/FasitHelper.php @@ -321,16 +321,7 @@ private function uploadFile(string $originalFilename, string $tempFilename): arr 'X-Filename' => $originalFilename, 'X-Title' => pathinfo($originalFilename, PATHINFO_FILENAME), ], - 'multipart' => [ - [ - 'name' => 'fileData', - 'contents' => Utils::tryFopen($tempFilename, 'r'), - 'filename' => pathinfo($tempFilename, PATHINFO_FILENAME), - 'headers' => [ - 'Content-Type' => '', - ], - ], - ], + 'body' => Utils::tryFopen($tempFilename, 'r'), 'cert' => $certificateOptions, ]; From abd45a2e8edaf3a3fba837b0ceb7c754e6f7ba2b Mon Sep 17 00:00:00 2001 From: jekuaitk Date: Mon, 22 Apr 2024 09:27:59 +0200 Subject: [PATCH 4/4] Code cleanup --- src/Plugin/AdvancedQueue/JobType/Fasit.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/Plugin/AdvancedQueue/JobType/Fasit.php b/src/Plugin/AdvancedQueue/JobType/Fasit.php index 4bfdf54..475aeb7 100644 --- a/src/Plugin/AdvancedQueue/JobType/Fasit.php +++ b/src/Plugin/AdvancedQueue/JobType/Fasit.php @@ -55,13 +55,7 @@ public static function create(ContainerInterface $container, array $configuratio * * @phpstan-param array $configuration */ - public function __construct( - array $configuration, - $plugin_id, - $plugin_definition, - FasitHelper $helper, - LoggerChannelFactoryInterface $loggerFactory - ) { + public function __construct(array $configuration, $plugin_id, $plugin_definition, FasitHelper $helper, LoggerChannelFactoryInterface $loggerFactory) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->helper = $helper; $this->submissionLogger = $loggerFactory->get('webform_submission');