mirror of
https://github.com/benbusby/farside.git
synced 2025-05-04 17:40:02 +00:00
Prepend /u/
for Bibliogram redirects if not present
Bibliogram links require a "/u/" prefix when viewing a user's profile, which does not match Instagram's URL paradigm. This adds a bit of logic for Bibliogram links to prepend this prefix if the user is not visiting a post (indicated by a "/p/" prefix, which Bibliogram and Instagram BOTH use) or the home page of an instance (indicated by an empty path value).
This commit is contained in:
parent
52833ef89e
commit
d280f961f5
2 changed files with 39 additions and 10 deletions
|
@ -66,9 +66,11 @@ defmodule Farside.Router do
|
|||
conn.assigns[:throttle] != nil ->
|
||||
Farside.get_service(service_name)
|
||||
|> Farside.last_instance
|
||||
|> Farside.amend_instance(service_name, path)
|
||||
true ->
|
||||
Farside.get_service(service_name)
|
||||
|> Farside.pick_instance
|
||||
|> Farside.amend_instance(service_name, path)
|
||||
end
|
||||
|
||||
# Redirect to the available instance
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue