Skip to content

Commit

Permalink
Fix: Browse page links multi slashes (#873)
Browse files Browse the repository at this point in the history
* fix multislashes added in browse page federation links

* ensure trailing slash in federation portals ui and api links

* undo extracting normalizing portals urls to a separate function
  • Loading branch information
Bilelkihal authored Nov 26, 2024
1 parent 450ddf4 commit e9bf264
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/helpers/federation_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ module FederationHelper

def federated_portals
$FEDERATED_PORTALS ||= LinkedData::Client.settings.federated_portals
$FEDERATED_PORTALS.each do |key, portal|
portal[:ui] += "/" unless portal[:ui].end_with?("/")
portal[:api] += "/" unless portal[:api].end_with?("/")
end
$FEDERATED_PORTALS
end

def internal_portal_config(id)
Expand Down Expand Up @@ -63,7 +68,7 @@ def ontoportal_ui_link(id)
ui_link = config[:ui]
api_link = config[:api]

id.gsub(api_link, "#{ui_link}/") rescue id
id.gsub(api_link, "#{ui_link}") rescue id
end

def internal_ontology?(id)
Expand Down

0 comments on commit e9bf264

Please sign in to comment.