Skip to content

Commit 13d334c

Browse files
Watson1978kenhys
authored andcommitted
v1_parser: use URI#open instead of URI.open (fluent#4854)
**Which issue(s) this PR fixes**: Fixes # **What this PR does / why we need it**: By [CodeQL documentation](https://codeql.github.com/codeql-query-help/ruby/rb-non-constant-kernel-open/), it is safer to avoid using `URI.open`. This is similar with fluent#4848 **Docs Changes**: **Release Note**: Signed-off-by: Shizuo Fujita <[email protected]> Signed-off-by: Kentaro Hayashi <[email protected]>
1 parent 854213b commit 13d334c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/fluent/config/v1_parser.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ def eval_include(attrs, elems, uri)
172172
require 'open-uri'
173173
basepath = '/'
174174
fname = path
175-
data = URI.open(uri) { |f| f.read }
175+
data = u.open { |f| f.read }
176176
data.force_encoding('UTF-8')
177177
ss = StringScanner.new(data)
178178
V1Parser.new(ss, basepath, fname, @eval_context).parse_element(true, nil, attrs, elems)

0 commit comments

Comments
 (0)