aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdnan Maolood <[email protected]>2021-02-19 18:06:54 -0500
committerAdnan Maolood <[email protected]>2021-02-19 18:06:54 -0500
commit76967dad2e67da07640da7f5d40da1b5d1f16248 (patch)
tree24884db15c2cb30f6befe14c2bab46258be172d9
parentserver: Remove Certificates field (diff)
downloadgo-gemini-76967dad2e67da07640da7f5d40da1b5d1f16248.tar.xz
go-gemini-76967dad2e67da07640da7f5d40da1b5d1f16248.zip
mux: Reject empty patterns
-rw-r--r--mux.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/mux.go b/mux.go
index 6818fea..3eec7f5 100644
--- a/mux.go
+++ b/mux.go
@@ -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")
}