Conversation
Update page.liquid .
✅ Deploy Preview for sustainableurbansystems ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| 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
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI about 1 month ago
Replace URI.open(url, ...) with URI.parse(url).open(...) (equivalently URI(url).open(...)). This keeps current behavior (fetching remote README over HTTPS with headers) while avoiding the unsafe URI.open pattern that CodeQL flags.
In _plugins/github-profile-readme.rb, update the line inside fetch_readme where content is fetched (currently line 42 in the snippet). No new dependency is required since open-uri is already required and URI.parse is part of Ruby’s standard URI library behavior used alongside it.
| @@ -39,7 +39,7 @@ | ||
| content = nil | ||
| urls.each do |url| | ||
| begin | ||
| content = URI.open(url, "User-Agent" => "Jekyll").read | ||
| content = URI.parse(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, |

No description provided.