diff options
| -rw-r--r-- | main.go | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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: |
