Compare commits
2 commits
ed2c342803
...
7a16480269
Author | SHA1 | Date | |
---|---|---|---|
Timo Ley | 7a16480269 | ||
Timo Ley | 1ba57ca22c |
|
@ -56,6 +56,13 @@ async fn on_request(
|
|||
.user_agent("curl")
|
||||
.timeout(Duration::from_secs(30))
|
||||
.build()?;
|
||||
let conf = body.config();
|
||||
if conf.starts_with("http://") || conf.starts_with("https://") {
|
||||
let drone_config = client.get(conf).send().await?.text().await?;
|
||||
let response = Response { data: drone_config };
|
||||
return Ok(Json(response));
|
||||
}
|
||||
|
||||
let auth = AuthQuery {
|
||||
access_token: token,
|
||||
};
|
||||
|
|
|
@ -10,6 +10,7 @@ pub struct Request {
|
|||
pub struct Repository {
|
||||
pub name: String,
|
||||
pub namespace: String,
|
||||
pub config_path: String,
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
|
@ -33,4 +34,8 @@ impl Request {
|
|||
pub fn name(&self) -> String {
|
||||
self.repo.name.clone()
|
||||
}
|
||||
|
||||
pub fn config(&self) -> String {
|
||||
self.repo.config_path.clone()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue