nzr-api: ensure / is at the end of the ci url
Without it, cloud-init tries accessing `http://1.1.1.1:80meta-data`.
This commit is contained in:
parent
c35d9ccbed
commit
deaaaa3d10
|
@ -56,9 +56,13 @@ pub struct CloudConfig {
|
|||
impl CloudConfig {
|
||||
pub fn http_addr(&self) -> String {
|
||||
if let Some(http_addr) = &self.http_addr {
|
||||
http_addr.clone()
|
||||
if http_addr.ends_with('/') {
|
||||
http_addr.clone()
|
||||
} else {
|
||||
format!("{}/", http_addr)
|
||||
}
|
||||
} else {
|
||||
format!("http://{}:{}", self.listen_addr, self.port)
|
||||
format!("http://{}:{}/", self.listen_addr, self.port)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue