server: change behavior in case of unhandled methods

(https://github.com/aler9/rtsp-simple-server/issues/1066)

Return 501 and keep connection open instead of returning 400 and
closing the connection.
This commit is contained in:
aler9
2022-08-07 13:49:15 +02:00
parent 4940e8faeb
commit a2c6a7fb97
4 changed files with 99 additions and 44 deletions

View File

@@ -48,16 +48,6 @@ func (e ErrServerCSeqMissing) Error() string {
return "CSeq is missing"
}
// ErrServerUnhandledRequest is an error that can be returned by a server.
type ErrServerUnhandledRequest struct {
Request *base.Request
}
// Error implements the error interface.
func (e ErrServerUnhandledRequest) Error() string {
return fmt.Sprintf("unhandled request: %v %v", e.Request.Method, e.Request.URL)
}
// ErrServerInvalidState is an error that can be returned by a server.
type ErrServerInvalidState struct {
AllowedList []fmt.Stringer