Added new test cases for "if" directive parsing

pull/37/merge
Andrew Krasichkov 2017-05-12 19:43:42 +03:00
parent 7d182dbdba
commit 26b2ead72c
1 changed files with 7 additions and 2 deletions

View File

@ -225,11 +225,14 @@ if (!-e "/var/data/$dataset") {
return 503;
}
if ($https_or_slb = (by_slb|https)) {
if ($https_or_slb = (by_\(sl\)b|https)) {
}
if ($host ~* (lori|rage2)\.yandex\.(ru|ua|com|com\.tr)) {
set $x_frame_options ALLOW;
}
if ($request_filename ~* ^.*?/(\d+_)([^/]+)$) {
}
'''
@ -253,11 +256,13 @@ if ($host ~* (lori|rage2)\.yandex\.(ru|ua|com|com\.tr)) {
['if', ['!-e', '/var/data/$dataset'], [
['return', '503']
]],
['if', ['$https_or_slb', '=', '(by_slb|https)'], [
['if', ['$https_or_slb', '=', '(by_\(sl\)b|https)'], [
]],
['if', ['$host', '~*', '(lori|rage2)\.yandex\.(ru|ua|com|com\.tr)'], [
['set', '$x_frame_options', 'ALLOW']
]],
['if', ['$request_filename', '~*', '^.*?/(\d+_)([^/]+)$'], [
]]
]
assert_config(config, expected)