diff --git a/app/controllers/concerns/hyrax/works_controller_behavior.rb b/app/controllers/concerns/hyrax/works_controller_behavior.rb index 1845904f62..3a5c040bce 100644 --- a/app/controllers/concerns/hyrax/works_controller_behavior.rb +++ b/app/controllers/concerns/hyrax/works_controller_behavior.rb @@ -176,7 +176,8 @@ def iiif_manifest_builder def iiif_manifest_presenter IiifManifestPresenter.new(search_result_document(id: params[:id])).tap do |p| - p.hostname = request.base_url + # Have to force the encoding of base_url to UTF8 because Loofah will strip out ASCII-8BIT strings in Hyrax::ManifestBuilderService#deep_sanitize + p.hostname = request.base_url.force_encoding('UTF-8') p.ability = current_ability end end diff --git a/spec/features/iiif_manifest_spec.rb b/spec/features/iiif_manifest_spec.rb index 6292246f53..31393dd121 100644 --- a/spec/features/iiif_manifest_spec.rb +++ b/spec/features/iiif_manifest_spec.rb @@ -18,6 +18,7 @@ visit "/concern/generic_works/#{work.id}/manifest" manifest_json = JSON.parse(page.body) + expect(manifest_json['@id']).to match "http://.*/concern/monographs/#{work.id}/manifest" expect(manifest_json['label']).to eq 'Comet in Moominland' expect(manifest_json['description']).to eq 'a novel about moomins'