diff options
Diffstat (limited to 'helpers.rb')
-rw-r--r-- | helpers.rb | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -24,6 +24,8 @@ helpers do def save_object(object, box) object = fetch(object) if object.is_a? String and object.match(/^http/) + return unless object + object['@context'] = 'https://www.w3.org/ns/activitystreams' basename = "#{object['published']}_#{mention(object['attributedTo'])}.json" object_rel_path = File.join 'object', object['type'].downcase, basename @@ -71,8 +73,7 @@ helpers do def curl(ext, url) p url - # p "/run/current-system/sw/bin/curl --fail-with-body -sSL #{ext} #{url}" - response = `/run/current-system/sw/bin/curl --fail-with-body -sSL #{ext} #{url}` + response = `/run/current-system/sw/bin/curl -H 'Content-Type: #{CONTENT_TYPE}' -H 'Accept: #{CONTENT_TYPE}' --fail-with-body -sSL #{ext} #{url}` if $CHILD_STATUS.success? response else |