Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed content-type header #6

Merged
merged 4 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ about writing changes to this log.

## [Unreleased]

## [1.0.2] 2024-04-22

- Fixed `Content-Type` header.

## [1.0.1] 2024-04-04

- Fixed queue install configuration.
Expand Down
13 changes: 2 additions & 11 deletions src/Helper/FasitHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,20 +317,11 @@ private function uploadFile(string $originalFilename, string $tempFilename): arr
try {
$options = [
'headers' => [
'Content-Type' => 'multipart/form-data',
'Content-Type' => 'application/pdf',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But you're sending multipart data (cf. line 324)!?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

'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' => '<Content-type header>',
],
],
],
'body' => Utils::tryFopen($tempFilename, 'r'),
'cert' => $certificateOptions,
];

Expand Down
8 changes: 1 addition & 7 deletions src/Plugin/AdvancedQueue/JobType/Fasit.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,7 @@ public static function create(ContainerInterface $container, array $configuratio
*
* @phpstan-param array<string, mixed> $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');
Expand Down
Loading