diff options
| author | Marin Ivanov <[email protected]> | 2025-06-22 17:49:32 +0300 |
|---|---|---|
| committer | Marin Ivanov <[email protected]> | 2025-06-22 17:49:32 +0300 |
| commit | 9608d6c132df1accbd67d8e04657928d2018c3ca (patch) | |
| tree | c7401fbd109466c753de7eafcb48728f1f477947 /main.go | |
| parent | 053c60c3a23b76d2014a35d02c7a8fc32908b55c (diff) | |
add text/x-url handing as redirect.
Diffstat (limited to 'main.go')
| -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: |
