rss-bridge icon indicating copy to clipboard operation
rss-bridge copied to clipboard

Redirecting a bridge?

Open mruac opened this issue 4 months ago • 4 comments

I'm updating the BlueskyBridge to not rely on user handles and instead use the decentralised identifier (DID), as it is possible to change the user handle, but the bridge has been pushed to here with the user handle option already included.

The way I am doing this is by correcting the bridge's existing parameter, so no new parameters are added or removed.

Is there a way to update a bridge so that it redirects to the same bridge with the corrected parameters?

An example would be from this: ?action=display&bridge=BlueskyBridge&data_source=getAuthorFeed&user_id=listifications.app&feed_filter=posts_and_author_threads&include_reposts=on&format=Html

To this: ?action=display&bridge=BlueskyBridge&data_source=getAuthorFeed&user_id=did:plc:yatb2t26fw7u3c7qcacq7rje&feed_filter=posts_and_author_threads&include_reposts=on&format=Html

In addition to this, is there a way to update the feed url for those feed readers already subscribed to it? Eg. updating the feed_url key in the JSON feed.

mruac avatar Aug 10 '25 08:08 mruac

potentially a feature request if not implemented already

mruac avatar Aug 10 '25 08:08 mruac

I could just do this in the bridge, but it doesn't feel right...

    header("Location: https://www.example.com", true, 301);
    exit();

The url could be tightened to only allow existing bridge names and parameters in the finalised version.

mruac avatar Aug 10 '25 08:08 mruac

proposing adding this this in ./lib/utils.php

function redirectBridge($parms){
    header('Location: ' . get_home_page_url() . '?' . http_build_query($parms), true, 301);
    exit();
}

A bridge can detect unsupported parameters with the PHP global variable, modify the parameters and then redirect with the corrected parameters.

parse_str(substr($_SERVER['REQUEST_URI'], 2), $uri_parms);
if (isset($uri_parms['user_id'])) {
    $uri_parms['user_id'] = $did;
}
redirectBridge($uri_parms);

mruac avatar Aug 10 '25 09:08 mruac

sorry I dont understand the primary purpose of this redirect.

why is redirect wanted?

dvikan avatar Aug 13 '25 18:08 dvikan