Skip to content

Conversation

@MegaManSec
Copy link

No description provided.

@sonarqubecloud
Copy link

@sonarqubecloud
Copy link

@dvershinin dvershinin requested a review from Copilot September 30, 2025 14:02
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for parsing capture groups in nginx if-blocks by implementing variable extraction from regex patterns. This enhancement fixes issue #50 by enabling proper handling of regex capture groups that can be referenced within if-blocks.

  • Modifies IfBlock class to provide variables from regex capture groups
  • Adds regex detection and variable extraction functionality
  • Updates test expectations to reflect new variable provision behavior

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
gixy/directives/block.py Implements variable extraction logic for if-blocks with regex patterns
tests/directives/test_block.py Updates test assertion to expect variable provision in if-blocks
tests/plugins/simply/http_splitting/if_block.conf Adds test case for if-block with capture group using $uri
tests/plugins/simply/http_splitting/if_block_fp.conf Adds test case for if-block with capture group using $request_uri

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@MegaManSec
Copy link
Author

fixed the merge conflict

@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 6, 2025

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.

1 participant