diff options
author | David Rothstein <drothstein@gmail.com> | 2016-02-01 11:10:22 -0500 |
---|---|---|
committer | David Rothstein <drothstein@gmail.com> | 2016-02-01 11:10:22 -0500 |
commit | 03cbe6517b64b7b22fb1bbcf3e753634d178cb0d (patch) | |
tree | eaed0ee96308edd27c7b7b6c169873cffa77a113 /modules/image/image.test | |
parent | d641314cc6157d7b164ccc2587f7b9eb4f568c1f (diff) | |
download | brdo-03cbe6517b64b7b22fb1bbcf3e753634d178cb0d.tar.gz brdo-03cbe6517b64b7b22fb1bbcf3e753634d178cb0d.tar.bz2 |
Issue #1891228 by eiriksm, logaritmisk, joelpittet, stefan.r, StefanPr, mariancalinro: image_style_deliver can create invalid headers
Diffstat (limited to 'modules/image/image.test')
-rw-r--r-- | modules/image/image.test | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/image/image.test b/modules/image/image.test index 87d803a53..42f8d8bca 100644 --- a/modules/image/image.test +++ b/modules/image/image.test @@ -202,6 +202,22 @@ class ImageStylesPathAndUrlTestCase extends DrupalWebTestCase { } /** + * Test that we do not pass an array to drupal_add_http_header. + */ + function testImageContentTypeHeaders() { + $files = $this->drupalGetTestFiles('image'); + $file = array_shift($files); + // Copy the test file to private folder. + $private_file = file_copy($file, 'private://', FILE_EXISTS_RENAME); + // Tell image_module_test module to return the headers we want to test. + variable_set('image_module_test_invalid_headers', $private_file->uri); + // Invoke image_style_deliver so it will try to set headers. + $generated_url = image_style_url($this->style_name, $private_file->uri); + $this->drupalGet($generated_url); + variable_del('image_module_test_invalid_headers'); + } + + /** * Test image_style_url(). */ function _testImageStyleUrlAndPath($scheme, $clean_url = TRUE, $extra_slash = FALSE) { |