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

Add header in the s3 S3StreamWrapper #30

Open
ping86 opened this issue Jun 17, 2014 · 0 comments
Open

Add header in the s3 S3StreamWrapper #30

ping86 opened this issue Jun 17, 2014 · 0 comments

Comments

@ping86
Copy link

ping86 commented Jun 17, 2014

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant