Prevent that users configure a pathprefix for the service uri.

This commit is contained in:
Tim Bruijnzeels
2020-06-19 15:18:39 +02:00
parent 3675a3b175
commit 4842e96e13
+8
View File
@@ -426,6 +426,14 @@ impl Config {
if !self.service_uri.ends_with('/') {
return Err(ConfigError::other("service URI must end with '/'"));
} else {
uri::Https::from_str(&self.service_uri).map_err(|_| {
ConfigError::Other(format!("Invalid service uri: {}", self.service_uri))
})?;
if self.service_uri.as_str().matches('/').count() != 3 {
return Err(ConfigError::other("Service URI MUST specify a host name only, e.g. https://rpki.example.com:3000/"));
}
}
if !self.rrdp_service_uri().to_string().ends_with('/') {