Skip to content

Conversation

@prasad-albert
Copy link
Collaborator

No description provided.

if not re.fullmatch(r"[A-Za-z0-9._/-]+", base_branch) or base_branch.startswith("-"):
raise ValueError(f"Invalid base branch ref: {base_branch!r}")

subprocess.run(["git", "fetch", "origin"], check=True)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

use subprocess instead of popen

status = "successful" if self.server.token else "failed (no token found)"
self.send_response(200)
self.send_header("Content-Type", "text/html")
self.send_header(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

set CSP header in response

_ALLOWED_NAMES = {"pi": math.pi}


def _safe_eval_math(*, expression: str) -> float:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

use custom eval using ast.eval insteaf of eval()

@lkubie lkubie self-requested a review January 27, 2026 10:55
Copy link
Collaborator

@lkubie lkubie left a comment

Choose a reason for hiding this comment

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

LGTM

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.

3 participants