Skip to content

Add header in the s3 S3StreamWrapper #30

@ping86

Description

@ping86

I need add in the Cybernox\AmazonWebServicesBundle\StreamWrapper\StreamWrapper file the header parameters.

In the function buildHeadersForContent I need adde the following header:

$headers['Cache-Control'] = "max-age=2592000";

  private function buildHeadersForContent($content)
    {
        $path = tempnam(sys_get_temp_dir(), 's3_mime_type');        
        file_put_contents($path, $content);

        $headers = array();

        //My custom header
        $headers['Cache-Control'] = "max-age=2592000";

        if($this->isFileGzipped($path)){
            $headers['Content-Encoding'] = "gzip";
        }

        unlink($path);

        return $headers;
    }

How I can do this without modifying the bundle? Is there any option?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions