mcp: gracefully handle a nil server in handlers (#164)
If the getServer function passed to NewSSEHandler or NewStreamableHTTPHandler returns nil, serve a 400 instead of panicking. Fixes #161.
This commit is contained in:
parent
8dd9a819bb
commit
c879ac3c61
1 changed files with 17 additions and 6 deletions
|
|
@ -53,5 +53,5 @@ func main() {
|
|||
return nil
|
||||
}
|
||||
})
|
||||
http.ListenAndServe(*httpAddr, handler)
|
||||
log.Fatal(http.ListenAndServe(*httpAddr, handler))
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue