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
|
||||
)
|
||||
|
||||
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(
|
||||
"It looks like the syntax for the 'more_set_headers' "
|
||||
"instruction is incorrect in the NGINX conf (N.B. "
|
||||
": it's different than the 'add_header' syntax!)... "
|
||||
"The syntax should look like: "
|
||||
'more_set_headers "Header-Name: value"'
|
||||
f"Offending line(s) [{lines}]"
|
||||
)
|
||||
|
||||
@test()
|
||||
|
|
Loading…
Reference in a new issue