summaryrefslogtreecommitdiff
path: root/helpers.rb
diff options
context:
space:
mode:
Diffstat (limited to 'helpers.rb')
-rw-r--r--helpers.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/helpers.rb b/helpers.rb
index 0db6566..94ec2e1 100644
--- a/helpers.rb
+++ b/helpers.rb
@@ -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