From 0b91a12ce12c219b7805f02359e1c62e6544c806 Mon Sep 17 00:00:00 2001 From: Manabu Niseki Date: Sun, 14 Jan 2024 08:29:20 +0900 Subject: [PATCH] refactor: improve type check --- docs/analyzers/feed.md | 2 +- lib/mihari/services/feed.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/analyzers/feed.md b/docs/analyzers/feed.md index 6428c4c59..1165fc40a 100644 --- a/docs/analyzers/feed.md +++ b/docs/analyzers/feed.md @@ -47,7 +47,7 @@ json: ... ### JSON -`json` (`hash`) is an JSON body. Optional. +`json` (`hash`) is a JSON data. Optional. ## Examples diff --git a/lib/mihari/services/feed.rb b/lib/mihari/services/feed.rb index 9532ff5a8..5cf769326 100644 --- a/lib/mihari/services/feed.rb +++ b/lib/mihari/services/feed.rb @@ -98,7 +98,7 @@ def call(input_enumerator, selector) input_enumerator.instance_eval(selector) end.call - raise TypeError unless parsed.all?(String) + raise TypeError unless parsed.is_a?(Array) || parsed.all?(String) parsed end