Skip to content

S3 PutObject presigned url ContentType ignored #1521

@raress96

Description

@raress96

Using version 3.2.6 from the Symfony Bundle.
I have the following code in my app:

`$cmd = $this->s3client->getCommand('PutObject', [
'Bucket' => 'myBucket',
'Key' => 'inputs/' . $movie->getId(),
'ACL' => 'private',
'ContentType' => 'video/mp4',
]);

    $request = $this->s3client->createPresignedRequest($cmd, '+30 minutes');

    $movie->setSignedUrl((string)$request->getUri());`

The uri generated is not correct because it does not include the Content-Type header at all so I am able to upload any type of file using this url.The X-Amz-SignedHeaders part of the url only contains the host header but not the content type or other headers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    guidanceQuestion that needs advice or information.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions