Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix code scanning alert #29: Incomplete URL substring sanitization #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

art-tykh
Copy link

Fixes https://github.com/MacPaw/fastlane/security/code-scanning/29

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…ation

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@art-tykh art-tykh requested a review from nekrich September 19, 2024 13:31
@@ -244,7 +244,7 @@ def setup_gemfile!

def ensure_gemfile_valid!(update_gemfile_if_needed: false)
gemfile_content = File.read(gemfile_path)
unless gemfile_content.include?("https://rubygems.org")
unless gemfile_content.lines.any? { |line| URI(line.strip).host == "rubygems.org" rescue false }
Copy link
Member

@nekrich nekrich Sep 19, 2024

Choose a reason for hiding this comment

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

I doubt this will work since the line is not URL source 'https://rubygems.org' or source("https://rubygems.org"), plus the case difference.

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