Skip to content

Commit

Permalink
Allowed more characters for map/upstream/etc directives
Browse files Browse the repository at this point in the history
  • Loading branch information
buglloc committed May 14, 2017
1 parent 3c1437c commit 7d8fb88
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gixy/parser/raw_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def script(self):

hash_block << (
keyword +
Group(OneOrMore(space + variable)) +
Group(OneOrMore(space + value)) +
Group(
left_bracket +
Optional(OneOrMore(hash_value)) +
Expand All @@ -144,7 +144,7 @@ def script(self):

generic_block << (
keyword +
Group(ZeroOrMore(space + variable)) +
Group(ZeroOrMore(space + value)) +
Group(
left_bracket +
Optional(sub_block) +
Expand All @@ -153,7 +153,7 @@ def script(self):

unparsed_block << (
keyword +
Group(ZeroOrMore(space + variable)) +
Group(ZeroOrMore(space + value)) +
nestedExpr(opener="{", closer="}")
)("unparsed_block")

Expand Down
16 changes: 16 additions & 0 deletions tests/parser/test_raw_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,22 @@ def test_comments():
assert_config(config, expected)


def test_upstream_dot():
config = '''
upstream test.mysite.com {
server 127.0.0.1:9009;
}
'''

expected = [
['upstream', ['test.mysite.com'], [
['server', '127.0.0.1:9009']
]],
]

assert_config(config, expected)


def test_empty_config():
config = '''
'''
Expand Down

0 comments on commit 7d8fb88

Please sign in to comment.