docs: Update v1.6 spec links to v1.7
This commit is contained in:
parent
89d12fa48a
commit
38f600c602
@ -9,8 +9,8 @@ pub mod v3 {
|
|||||||
//! [by their Matrix identifier][spec-mxid], and one to invite a user
|
//! [by their Matrix identifier][spec-mxid], and one to invite a user
|
||||||
//! [by their third party identifier][spec-3pid].
|
//! [by their third party identifier][spec-3pid].
|
||||||
//!
|
//!
|
||||||
//! [spec-mxid]: https://spec.matrix.org/v1.6/client-server-api/#post_matrixclientv3roomsroomidinvite
|
//! [spec-mxid]: https://spec.matrix.org/v1.7/client-server-api/#post_matrixclientv3roomsroomidinvite
|
||||||
//! [spec-3pid]: https://spec.matrix.org/v1.6/client-server-api/#post_matrixclientv3roomsroomidinvite-1
|
//! [spec-3pid]: https://spec.matrix.org/v1.7/client-server-api/#post_matrixclientv3roomsroomidinvite-1
|
||||||
|
|
||||||
use ruma_common::{
|
use ruma_common::{
|
||||||
api::{request, response, Metadata},
|
api::{request, response, Metadata},
|
||||||
|
@ -583,7 +583,7 @@ mod tests {
|
|||||||
assert!(!"m".matches_word("[[:alpha:]]?"));
|
assert!(!"m".matches_word("[[:alpha:]]?"));
|
||||||
assert!("[[:alpha:]]!".matches_word("[[:alpha:]]?"));
|
assert!("[[:alpha:]]!".matches_word("[[:alpha:]]?"));
|
||||||
|
|
||||||
// From the spec: <https://spec.matrix.org/v1.6/client-server-api/#conditions-1>
|
// From the spec: <https://spec.matrix.org/v1.7/client-server-api/#conditions-1>
|
||||||
assert!("An example event.".matches_word("ex*ple"));
|
assert!("An example event.".matches_word("ex*ple"));
|
||||||
assert!("exple".matches_word("ex*ple"));
|
assert!("exple".matches_word("ex*ple"));
|
||||||
assert!("An exciting triple-whammy".matches_word("ex*ple"));
|
assert!("An exciting triple-whammy".matches_word("ex*ple"));
|
||||||
@ -632,7 +632,7 @@ mod tests {
|
|||||||
assert!("".matches_pattern("*", false));
|
assert!("".matches_pattern("*", false));
|
||||||
assert!(!"foo".matches_pattern("", false));
|
assert!(!"foo".matches_pattern("", false));
|
||||||
|
|
||||||
// From the spec: <https://spec.matrix.org/v1.6/client-server-api/#conditions-1>
|
// From the spec: <https://spec.matrix.org/v1.7/client-server-api/#conditions-1>
|
||||||
assert!("Lunch plans".matches_pattern("lunc?*", false));
|
assert!("Lunch plans".matches_pattern("lunc?*", false));
|
||||||
assert!("LUNCH".matches_pattern("lunc?*", false));
|
assert!("LUNCH".matches_pattern("lunc?*", false));
|
||||||
assert!(!" lunch".matches_pattern("lunc?*", false));
|
assert!(!" lunch".matches_pattern("lunc?*", false));
|
||||||
|
@ -77,7 +77,7 @@ pub enum MxcUriError {
|
|||||||
/// Media identifier malformed due to invalid characters detected.
|
/// Media identifier malformed due to invalid characters detected.
|
||||||
///
|
///
|
||||||
/// Valid characters are (in regex notation) `[A-Za-z0-9_-]+`.
|
/// Valid characters are (in regex notation) `[A-Za-z0-9_-]+`.
|
||||||
/// See [here](https://spec.matrix.org/v1.6/client-server-api/#security-considerations-5) for more details.
|
/// See [here](https://spec.matrix.org/v1.7/client-server-api/#security-considerations-5) for more details.
|
||||||
#[error("Media Identifier malformed, invalid characters")]
|
#[error("Media Identifier malformed, invalid characters")]
|
||||||
MediaIdMalformed,
|
MediaIdMalformed,
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ pub fn validate(uri: &str) -> Result<NonZeroU8, MxcUriError> {
|
|||||||
|
|
||||||
let server_name = &uri[..index];
|
let server_name = &uri[..index];
|
||||||
let media_id = &uri[index + 1..];
|
let media_id = &uri[index + 1..];
|
||||||
// See: https://spec.matrix.org/v1.6/client-server-api/#security-considerations-5
|
// See: https://spec.matrix.org/v1.7/client-server-api/#security-considerations-5
|
||||||
let media_id_is_valid =
|
let media_id_is_valid =
|
||||||
media_id.bytes().all(|b| matches!(b, b'0'..=b'9' | b'a'..=b'z' | b'A'..=b'Z' | b'-' ));
|
media_id.bytes().all(|b| matches!(b, b'0'..=b'9' | b'a'..=b'z' | b'A'..=b'Z' | b'-' ));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user