diff options
| author | Adnan Maolood <[email protected]> | 2021-02-19 18:06:54 -0500 |
|---|---|---|
| committer | Adnan Maolood <[email protected]> | 2021-02-19 18:06:54 -0500 |
| commit | 76967dad2e67da07640da7f5d40da1b5d1f16248 (patch) | |
| tree | 24884db15c2cb30f6befe14c2bab46258be172d9 | |
| parent | server: Remove Certificates field (diff) | |
| download | go-gemini-76967dad2e67da07640da7f5d40da1b5d1f16248.tar.xz go-gemini-76967dad2e67da07640da7f5d40da1b5d1f16248.zip | |
mux: Reject empty patterns
| -rw-r--r-- | mux.go | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -219,6 +219,9 @@ func (mux *ServeMux) ServeGemini(w ResponseWriter, r *Request) { // Handle registers the handler for the given pattern. // If a handler already exists for pattern, Handle panics. func (mux *ServeMux) Handle(pattern string, handler Handler) { + if pattern == "" { + panic("gemini: invalid pattern") + } if handler == nil { panic("gemini: nil handler") } |