Redirecting a bridge?
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.
potentially a feature request if not implemented already
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.
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);
sorry I dont understand the primary purpose of this redirect.
why is redirect wanted?