Skip to content

Conversation

@oliveromahony
Copy link
Contributor

@oliveromahony oliveromahony commented Jan 15, 2025

Proposed changes

An issue was discovered when parsing configurations with ssl_certificate_by_lua_block in them. This is intended to add a fix and tests covering those scenarios

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING document
  • If applicable, I have added tests that prove my fix is effective or that my feature works
  • If applicable, I have checked that any relevant tests pass after adding my changes
  • I have updated any relevant documentation (README.md)
@oliveromahony oliveromahony changed the title added failing tests for lua scenarios Lua scenarios where configuration parsed incorrectly Jan 15, 2025
Comment on lines +324 to +326
{"{", 3},
{"print(\"Test lua ssl certificate!\")", 4},
{"}", 5},
Copy link
Collaborator

@xynicole xynicole Jan 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{"\n print(\"Test lua ssl certificate!\")\n ",5},	{";", 5}, 

We grab everything in the Lua block as a single token and drop the {}. Example:
content_by_lua_block {some code} will be content_by_lua_block "some code"; "some code" is an argument of directive.

For reference: #86

Comment on lines +376 to +378
{"\n print(\"Test lua ssl certificate!\")\n ", 19},
{")", 20},
{"}", 21},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{"\n print(\"Test lua ssl certificate!\")\n ", 19},
{")", 20},
{"}", 21},
{"\n print(\"Test lua ssl certificate!\")\n ",21},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants