aboutsummaryrefslogtreecommitdiff
path: root/mux.go
Commit message (Collapse)AuthorAgeFilesLines
* mux: Tweak documentationv0.2.2Adnan Maolood2021-06-261-3/+3
|
* mux: Remove support for handling schemesAdnan Maolood2021-06-261-85/+63
| | | | | Also fix redirection to subtree roots for wildcard patterns and patterns without a host name.
* mux: Add copyright noticeAdnan Maolood2021-03-241-0/+4
|
* Rename ServeMux to MuxAdnan Maolood2021-03-151-13/+13
|
* Make ResponseWriter an interfaceAdnan Maolood2021-02-241-1/+1
| | | | | | | Make ResponseWriter an interface with an unexported method. Implementors must embed a ResponseWriter from elsewhere. This gives us the flexibility of an interface while allowing us to add new methods in the future.
* Make ResponseWriter a structAdnan Maolood2021-02-231-1/+1
| | | | | Make ResponseWriter a struct again so that it can be extended in a backwards-compatible way.
* ServeMux.HandleFunc: Take a HandlerFunc argumentAdnan Maolood2021-02-231-5/+2
|
* mux: Use StatusHandler instead of RedirectHandlerAdnan Maolood2021-02-201-2/+2
|
* handler: Make ServeGemini accept a ContextAdnan Maolood2021-02-201-3/+4
|
* mux: Reject empty patternsAdnan Maolood2021-02-191-0/+3
|
* mux: Implement matching of schemes and hostnamesAdnan Maolood2021-02-171-50/+138
|
* Redesign ResponseWriter interfaceAdnan Maolood2021-02-171-3/+3
|
* server: Rename responder to handlerAdnan Maolood2021-02-151-2/+2
|
* Make ResponseWriter an interfaceAdnan Maolood2021-02-091-2/+2
|
* Rename Responder to HandlerAdnan Maolood2021-02-081-14/+14
|
* Add missing error handlingHugo Wetterberg2021-01-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Error handling is currently missing is a couple of places. Most of them are i/o related. This change adds checks, an therefore sometimes also has to change function signatures by adding an error return value. In the case of the response writer the status and meta handling is changed and this also breaks the API. In some places where we don't have any reasonable I've added assignment to a blank identifier to make it clear that we're ignoring an error. text: read the Err() that can be set by the scanner. client: check if conn.SetDeadline() returns an error. client: check if req.Write() returns an error. fs: panic if mime type registration fails. server: stop performing i/o in Header/Status functions By deferring the actual header write to the first Write() or Flush() call we don't have to do any error handling in Header() or Status(). As Server.respond() now defers a ResponseWriter.Flush() instead of directly flushing the underlying bufio.Writer this has the added benefit of ensuring that we always write a header to the client, even if the responder is a complete NOOP. tofu: return an error if we fail to write to the known hosts writer.
* Remove Redirect and PermanentRedirect functionsAdnan Maolood2020-10-311-2/+2
| | | | Use (*ResponseWriter).WriteHeader instead.
* Refactor server certificatesAdnan Maolood2020-10-281-0/+210