diff options
| author | Adnan Maolood <[email protected]> | 2022-02-16 12:01:55 -0500 |
|---|---|---|
| committer | Adnan Maolood <[email protected]> | 2022-02-16 12:01:55 -0500 |
| commit | 353416685a780c5ef50e3e69f87dcd68e4aec529 (patch) | |
| tree | f61ca7e86d93ab3d05fe7dddfc35b8031c6e93cc /doc.go | |
| parent | readme: Update Gemini specification version (diff) | |
| download | go-gemini-353416685a780c5ef50e3e69f87dcd68e4aec529.tar.xz go-gemini-353416685a780c5ef50e3e69f87dcd68e4aec529.zip | |
doc: Fix Mux documentation
Diffstat (limited to 'doc.go')
| -rw-r--r-- | doc.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -30,7 +30,7 @@ Servers should be configured with certificates: server.GetCertificate = certificates.Get Mux is a Gemini request multiplexer. -Mux can handle requests for multiple hosts and schemes. +Mux can handle requests for multiple hosts and paths. mux := &gemini.Mux{} mux.HandleFunc("example.com", func(ctx context.Context, w gemini.ResponseWriter, r *gemini.Request) { @@ -39,8 +39,8 @@ Mux can handle requests for multiple hosts and schemes. mux.HandleFunc("example.org/about.gmi", func(ctx context.Context, w gemini.ResponseWriter, r *gemini.Request) { fmt.Fprint(w, "About example.org") }) - mux.HandleFunc("http://example.net", func(ctx context.Context, w gemini.ResponseWriter, r *gemini.Request) { - fmt.Fprint(w, "Proxied content from http://example.net") + mux.HandleFunc("/images/", func(ctx context.Context, w gemini.ResponseWriter, r *gemini.Request) { + w.WriteHeader(gemini.StatusGone, "Gone forever") }) server.Handler = mux |