Skip to content

Conversation

@kastnerp
Copy link
Member

No description provided.

@netlify
Copy link

netlify bot commented Jan 24, 2026

Deploy Preview for sustainableurbansystems ready!

Name Link
🔨 Latest commit 8527f83
🔍 Latest deploy log https://app.netlify.com/projects/sustainableurbansystems/deploys/6975437547be06000841bc84
😎 Deploy Preview https://deploy-preview-36--sustainableurbansystems.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 60
Accessibility: 98
Best Practices: 92
SEO: 99
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@kastnerp kastnerp merged commit 755f20a into main Jan 24, 2026
7 of 8 checks passed
content = nil
urls.each do |url|
begin
content = URI.open(url, "User-Agent" => "Jekyll").read

Check failure

Code scanning / CodeQL

Use of `Kernel.open` or `IO.read` or similar sinks with a non-constant value Critical

Call to URI.open with a non-constant value. Consider replacing it with URI().open.

Copilot Autofix

AI 2 days ago

In general, the fix is to avoid URI.open with a dynamic argument and instead either (a) construct a URI object explicitly and call open on it, which avoids the Kernel.open resolution that static analysis tools complain about, or (b) use a dedicated HTTP client (such as Net::HTTP) to fetch remote content. Both approaches make the intent explicit and avoid the ambiguous URI.open shortcut.

For this specific code, the minimal, behavior-preserving change is to replace URI.open(url, "User-Agent" => "Jekyll").read with URI(url).open("User-Agent" => "Jekyll").read. This continues to use open-uri (already required at the top of the file), preserves the custom User-Agent header, and keeps the same exception-handling behavior, while addressing the CodeQL complaint. No other parts of the file need to change, and no new imports are required because require 'open-uri' already brings in URI extensions.

Concretely, in _plugins/github-profile-readme.rb, inside fetch_readme(handle), change line 42 from content = URI.open(url, "User-Agent" => "Jekyll").read to content = URI(url).open("User-Agent" => "Jekyll").read. No additional methods, helper functions, or definitions are needed.

Suggested changeset 1
_plugins/github-profile-readme.rb

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/_plugins/github-profile-readme.rb b/_plugins/github-profile-readme.rb
--- a/_plugins/github-profile-readme.rb
+++ b/_plugins/github-profile-readme.rb
@@ -39,7 +39,7 @@
       content = nil
       urls.each do |url|
         begin
-          content = URI.open(url, "User-Agent" => "Jekyll").read
+          content = URI(url).open("User-Agent" => "Jekyll").read
           break if content && !content.strip.empty?
         rescue OpenURI::HTTPError, SocketError, Timeout::Error, Errno::ECONNRESET,
                Errno::ETIMEDOUT, Errno::ECONNREFUSED, Errno::EHOSTUNREACH,
EOF
@@ -39,7 +39,7 @@
content = nil
urls.each do |url|
begin
content = URI.open(url, "User-Agent" => "Jekyll").read
content = URI(url).open("User-Agent" => "Jekyll").read
break if content && !content.strip.empty?
rescue OpenURI::HTTPError, SocketError, Timeout::Error, Errno::ECONNRESET,
Errno::ETIMEDOUT, Errno::ECONNREFUSED, Errno::EHOSTUNREACH,
Copilot is powered by AI and may make mistakes. Always verify output.
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