Skip to content

Lua scenarios where configuration parsed incorrectly - #131

Draft
oliveromahony wants to merge 4 commits into
mainfrom
lua-duplicate-server
Draft

Lua scenarios where configuration parsed incorrectly#131
oliveromahony wants to merge 4 commits into
mainfrom
lua-duplicate-server

Conversation

@oliveromahony

@oliveromahony oliveromahony commented Jan 15, 2025

Copy link
Copy Markdown
Contributor

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 thread lex_test.go
Comment on lines +324 to +326
{"{", 3},
{"print(\"Test lua ssl certificate!\")", 4},
{"}", 5},

@xynicole xynicole Jan 22, 2025

Copy link
Copy Markdown
Collaborator

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 thread lex_test.go
Comment on lines +376 to +378
{"\n print(\"Test lua ssl certificate!\")\n ", 19},
{")", 20},
{"}", 21},

Copy link
Copy Markdown
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants