Skip to content

Commit

Permalink
redirect to gemini:// on upload to non-existing path
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkr committed Feb 8, 2025
1 parent e7f54f8 commit af26661
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions front/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,13 @@ func (h *Handler) Handle(r *Request, w text.Writer) {

r.Log.Warn("Received an invalid request")

if r.User == nil {
if r.URL.Scheme == "gemini" && r.User == nil {
w.Redirect("/oops")
} else {
} else if r.URL.Scheme == "gemini" && r.User != nil {
w.Redirect("/users/oops")
} else if r.User == nil {
w.Redirectf("gemini://%s/oops", h.Domain)
} else {
w.Redirectf("gemini://%s/users/oops", h.Domain)
}
}

0 comments on commit af26661

Please sign in to comment.