Redirecting to other servers #26

Closed
opened 2021-06-23 13:36:55 +00:00 by nihilazo · 3 comments

I have a site on one server (gemini://breadpunk.club/~bagel) that I would like to redirect to another server (gemini://tilde.town/~nihilazo). I do not have admin access to the server but I can set up a mollyfile to redirect, like so:

[TempRedirects]
"/~bagel/" = "gemini://tilde.town/~nihilazo"
"/bakers/bagel = "gemini://tilde.town/~nihilazo"

However when I visit this in amfora, I am not redirected to gemini://tilde.town/~nihilazo, but instead to gemini://breadpunk.club/gemini://tilde.town/~nihilazo
this seems to be a bug in molly brown rather than in my client (amfora).

Does molly brown support this and it's a bug, or is this not a feature?

I have a site on one server (gemini://breadpunk.club/~bagel) that I would like to redirect to another server (gemini://tilde.town/~nihilazo). I do not have admin access to the server but I can set up a mollyfile to redirect, like so: ``` [TempRedirects] "/~bagel/" = "gemini://tilde.town/~nihilazo" "/bakers/bagel = "gemini://tilde.town/~nihilazo" ``` However when I visit this in amfora, I am not redirected to gemini://tilde.town/~nihilazo, but instead to gemini://breadpunk.club/gemini://tilde.town/~nihilazo this seems to be a bug in molly brown rather than in my client (amfora). Does molly brown support this and it's a bug, or is this not a feature?
Contributor

Molly Brown doesn't support absolute redirects. This can be seen in this line: e42c366565/handler.go (L196) Only the path of the URL is modified.

A quick fix for you could be to add an if statement that would check if dst contains ://, and if it does, then do conn.Write([]byte(strStatus + " " + dst + "\r\n")) instead of the current line 196 and 197.

Molly Brown doesn't support absolute redirects. This can be seen in this line: https://tildegit.org/solderpunk/molly-brown/src/commit/e42c366565325b567d0d3dd8b78759e70ce20f48/handler.go#L196 Only the path of the URL is modified. A quick fix for you could be to add an if statement that would check if `dst` contains `://`, and if it does, then do `conn.Write([]byte(strStatus + " " + dst + "\r\n"))` instead of the current line 196 and 197.
Author

A quick fix for you could be to add an if statement that would check if dst contains ://, and if it does, then do conn.Write([]byte(strStatus + " " + dst + "\r\n")) instead of the current line 196 and 197.

sadly I don't have admin rights on this server to modify that :( But thanks for the fix

> A quick fix for you could be to add an if statement that would check if `dst` contains `://`, and if it does, then do `conn.Write([]byte(strStatus + " " + dst + "\r\n"))` instead of the current line 196 and 197. sadly I don't have admin rights on this server to modify that :( But thanks for the fix
Owner

Believe me, I'm embarrassed and ashamed that it's coming two years late, when @nihilazo isn't even active on Gemini anymore, but: the fact that Molly can't do cross-domain redirects isn't a limitation I deliberately put in there, it's just an oversight. I have need of this ability myself now. I'll write the code to fix this probably this week, and do a new release probably in February once I've handled some other changes, too. Sorry it didn't a lot sooner, and thanks for opening the issue. 🙏

Believe me, I'm embarrassed and ashamed that it's coming two years late, when @nihilazo isn't even active on Gemini anymore, but: the fact that Molly can't do cross-domain redirects isn't a limitation I deliberately put in there, it's just an oversight. I have need of this ability myself now. I'll write the code to fix this probably this week, and do a new release probably in February once I've handled some other changes, too. Sorry it didn't a lot sooner, and thanks for opening the issue. 🙏
Sign in to join this conversation.
No Label
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: solderpunk/molly-brown#26
No description provided.