diff options
author | Claire <claire.github-309c@sitedethib.com> | 2023-02-09 12:46:12 +0100 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2023-02-09 12:46:12 +0100 |
commit | 85558a5e18a58247606954050a5866e62c877f91 (patch) | |
tree | 982808241c0f64c20f8eec9b1ce5651b3c5195da /app/helpers/jsonld_helper.rb | |
parent | 76b4e7727b7497c1b68e06133831701f8950ae19 (diff) | |
parent | c5a4d8c82ddd5265abc830959a58cdaf1f061a43 (diff) |
Merge branch 'main' into glitch-soc/merge-upstream
Conflicts: - `README.md`: Minor upstream change, our README is completely different. Kept ours. - `lib/tasks/assets.rake`: glitch-soc has extra code to deal with its theming system, upstream changed a line that exists in glitch-soc. Applied upstream changes.
Diffstat (limited to 'app/helpers/jsonld_helper.rb')
-rw-r--r-- | app/helpers/jsonld_helper.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/helpers/jsonld_helper.rb b/app/helpers/jsonld_helper.rb index 102e4b132..e5787fd47 100644 --- a/app/helpers/jsonld_helper.rb +++ b/app/helpers/jsonld_helper.rb @@ -213,7 +213,7 @@ module JsonLdHelper end end - def load_jsonld_context(url, _options = {}, &_block) + def load_jsonld_context(url, _options = {}, &block) json = Rails.cache.fetch("jsonld:context:#{url}", expires_in: 30.days, raw: true) do request = Request.new(:get, url) request.add_headers('Accept' => 'application/ld+json') @@ -226,6 +226,6 @@ module JsonLdHelper doc = JSON::LD::API::RemoteDocument.new(json, documentUrl: url) - block_given? ? yield(doc) : doc + block ? yield(doc) : doc end end |