Skip to content
代码片段 群组 项目
未验证 提交 02fcd144 编辑于 作者: Joern Schneeweisz's avatar Joern Schneeweisz 提交者: GitLab
浏览文件

Make allowlist case-sensitive

上级 9c22b944
No related branches found
No related tags found
无相关合并请求
......@@ -11,10 +11,8 @@ module Utils
ConcurrentRubyThreadIsUsedError = Class.new(StandardError)
def allowlisted?(absolute_path, allowlist)
path = absolute_path.downcase
allowlist.map(&:downcase).any? do |allowed_path|
path.start_with?(allowed_path)
allowlist.any? do |allowed_path|
absolute_path.start_with?(allowed_path)
end
end
......
......@@ -21,6 +21,10 @@
it 'returns false if path is not allowed' do
expect(allowlisted?('/test/test', allowed_paths)).to be(false)
end
it 'returns false if path is in different case' do
expect(allowlisted?('/Foo/bar', allowed_paths)).to be(false)
end
end
describe '.decode_path' do
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册