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 267dc42
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion front/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,11 @@ func (h *Handler) Handle(r *Request, w text.Writer) {

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

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

0 comments on commit 267dc42

Please sign in to comment.