From 9608d6c132df1accbd67d8e04657928d2018c3ca Mon Sep 17 00:00:00 2001 From: Marin Ivanov Date: Sun, 22 Jun 2025 17:49:32 +0300 Subject: add text/x-url handing as redirect. --- main.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main.go b/main.go index 6aa5c8a..8c02dd3 100644 --- a/main.go +++ b/main.go @@ -178,6 +178,16 @@ func (s *Server) servePosting(w http.ResponseWriter, r *http.Request, name strin case "text/x-ansi": serveAnsiHtml(w, filename) return + case "text/x-url": + location, err := os.ReadFile(filename) + if err != nil { + log.Print("read(): ", err) + w.WriteHeader(http.StatusNotFound) + return + } + w.Header().Add("location", string(location)) + w.WriteHeader(http.StatusFound) + return case "": m.ContentType = "application/octet-stream" default: -- cgit v1.2.3