server: do not allow a client to change path name during PLAY or RECORD

This commit is contained in:
aler9
2021-07-31 21:26:57 +02:00
parent 288715c270
commit 45db8582b0
2 changed files with 24 additions and 0 deletions

View File

@@ -238,3 +238,14 @@ type ErrServerInvalidSession struct{}
func (e ErrServerInvalidSession) Error() string {
return "invalid session"
}
// ErrServerPathHasChanged is an error that can be returned by a server.
type ErrServerPathHasChanged struct {
Prev string
Cur string
}
// Error implements the error interface.
func (e ErrServerPathHasChanged) Error() string {
return fmt.Sprintf("path has changed, was '%s', now is '%s'", e.Prev, e.Cur)
}