server: fix crash with invalid SETUP request (bluenviron/mediamtx#4025) (#652)

This commit is contained in:
Alessandro Ros
2024-12-08 18:58:13 +01:00
committed by GitHub
parent fb61e9a922
commit db334b3a8d
3 changed files with 92 additions and 39 deletions

View File

@@ -261,12 +261,12 @@ func (e ErrServerStreamClosed) Error() string {
return "stream is closed"
}
// ErrServerPathNoSlash is an error that can be returned by a server.
type ErrServerPathNoSlash struct{}
// ErrServerInvalidSetupPath is an error that can be returned by a server.
type ErrServerInvalidSetupPath struct{}
// Error implements the error interface.
func (ErrServerPathNoSlash) Error() string {
return "path of a SETUP request must end with a slash. " +
func (ErrServerInvalidSetupPath) Error() string {
return "invalid SETUP path. " +
"This typically happens when VLC fails a request, and then switches to an " +
"unsupported RTSP dialect"
}