Skip to content

Commit 1f61df7

Browse files
nepomucmarianaballa
authored andcommitted
Setting header "Vary: Origin" only if the "Access-Control-Allow-Origin"-header is dynamic.
1 parent cfae285 commit 1f61df7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

public_html/lists/index.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@
5454

5555
$I18N = new phplist_I18N();
5656
header('Access-Control-Allow-Origin: '.ACCESS_CONTROL_ALLOW_ORIGIN);
57-
header('Vary: Origin'); // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin#CORS_and_caching
57+
if (defined('ACCESS_CONTROL_ALLOW_ORIGINS') && count('ACCESS_CONTROL_ALLOW_ORIGINS') > 1) {
58+
header('Vary: Origin'); // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin#CORS_and_caching
59+
}
5860

5961
if (!empty($GLOBALS['SessionTableName'])) {
6062
require_once dirname(__FILE__).'/admin/sessionlib.php';

0 commit comments

Comments
 (0)