mirror of
https://github.com/inspec/inspec
synced 2024-12-02 01:19:30 +00:00
http resource: Add fallback to #to_s
This prevents a stack trace from being shown to the user if the `http` resource is used on an unsupported platform. Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
This commit is contained in:
parent
55ab0ead32
commit
af5d6e9285
1 changed files with 5 additions and 1 deletions
|
@ -63,7 +63,11 @@ module Inspec::Resources
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_s
|
def to_s
|
||||||
"http #{http_method} on #{@url}"
|
if @opts and @url
|
||||||
|
"HTTP #{http_method} on #{@url}"
|
||||||
|
else
|
||||||
|
'HTTP Resource'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class Worker
|
class Worker
|
||||||
|
|
Loading…
Reference in a new issue