From d30a61a4e25505d04c47bce68ca0f090febb092d Mon Sep 17 00:00:00 2001 From: Jack Kleeman Date: Fri, 13 Dec 2024 16:22:19 +0000 Subject: [PATCH] Check for maximum versions as well --- src/vm/mod.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/vm/mod.rs b/src/vm/mod.rs index 0631c2e..d8bf7c6 100644 --- a/src/vm/mod.rs +++ b/src/vm/mod.rs @@ -150,10 +150,17 @@ impl super::VM for CoreVM { .ok_or(errors::MISSING_CONTENT_TYPE)? .parse::()?; - if version < Version::minimum_supported_version() { + if version < Version::minimum_supported_version() + || version > Version::maximum_supported_version() + { return Err(Error::new( errors::codes::UNSUPPORTED_MEDIA_TYPE, - format!("Unsupported protocol version {:?}", version), + format!( + "Unsupported protocol version {:?}. Supported versions: {:?} to {:?}", + version, + Version::minimum_supported_version(), + Version::maximum_supported_version() + ), )); }