mirror of
https://github.com/YunoHost/package_linter.git
synced 2024-09-03 20:06:12 +02:00
Show offending lines for 'more_set_headers'
This commit is contained in:
parent
d0c763ee28
commit
8ed7286c90
1 changed files with 3 additions and 1 deletions
|
@ -1421,13 +1421,15 @@ class Configurations(TestSuite):
|
||||||
r"more_set_headers [\"\'][\w-]+\s?: .*[\"\'];", line
|
r"more_set_headers [\"\'][\w-]+\s?: .*[\"\'];", line
|
||||||
)
|
)
|
||||||
|
|
||||||
if any(not right_syntax(line) for line in more_set_headers_lines):
|
lines = [line.strip() for line in more_set_headers_lines if not right_syntax(line)]
|
||||||
|
if lines:
|
||||||
yield Error(
|
yield Error(
|
||||||
"It looks like the syntax for the 'more_set_headers' "
|
"It looks like the syntax for the 'more_set_headers' "
|
||||||
"instruction is incorrect in the NGINX conf (N.B. "
|
"instruction is incorrect in the NGINX conf (N.B. "
|
||||||
": it's different than the 'add_header' syntax!)... "
|
": it's different than the 'add_header' syntax!)... "
|
||||||
"The syntax should look like: "
|
"The syntax should look like: "
|
||||||
'more_set_headers "Header-Name: value"'
|
'more_set_headers "Header-Name: value"'
|
||||||
|
f"Offending line(s) [{lines}]"
|
||||||
)
|
)
|
||||||
|
|
||||||
@test()
|
@test()
|
||||||
|
|
Loading…
Reference in a new issue