mirror of
https://github.com/certbot/certbot.git
synced 2026-07-27 08:09:10 +02:00
Merge branch 'master' into apache_modules
This commit is contained in:
@@ -37,7 +37,7 @@ class RawNginxParser(object):
|
||||
+ Group(ZeroOrMore(Group(comment | assignment) | block))
|
||||
+ right_bracket)
|
||||
|
||||
script = OneOrMore(Group(comment | assignment) | block) + stringEnd
|
||||
script = OneOrMore(Group(comment | assignment) ^ block) + stringEnd
|
||||
|
||||
def __init__(self, source):
|
||||
self.source = source
|
||||
|
||||
@@ -5,7 +5,7 @@ import unittest
|
||||
from pyparsing import ParseException
|
||||
|
||||
from letsencrypt_nginx.nginxparser import (
|
||||
RawNginxParser, load, dumps, dump)
|
||||
RawNginxParser, loads, load, dumps, dump)
|
||||
from letsencrypt_nginx.tests import util
|
||||
|
||||
|
||||
@@ -160,6 +160,13 @@ class TestRawNginxParser(unittest.TestCase):
|
||||
['#', ' listen 80;']]],
|
||||
])
|
||||
|
||||
def test_issue_518(self):
|
||||
parsed = loads('if ($http_accept ~* "webp") { set $webp "true"; }')
|
||||
|
||||
self.assertEqual(parsed, [
|
||||
[['if', '($http_accept ~* "webp")'],
|
||||
[['set', '$webp "true"']]]
|
||||
])
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main() # pragma: no cover
|
||||
|
||||
Reference in New Issue
Block a user