Fix Caddy configuration patching
All checks were successful
Build / build (push) Successful in 1m51s
All checks were successful
Build / build (push) Successful in 1m51s
This commit is contained in:
parent
35167f9d10
commit
0718608de1
1 changed files with 2 additions and 1 deletions
|
@ -132,7 +132,7 @@ impl CaddyController {
|
||||||
"terminal": true
|
"terminal": true
|
||||||
});
|
});
|
||||||
|
|
||||||
let mut request = Request::post(Url::from_str(&format!("http://localhost/id/{}", domain))?);
|
let mut request = Request::patch(Url::from_str(&format!("http://localhost/id/{}", domain))?);
|
||||||
request.insert_header("Content-Type", "application/json");
|
request.insert_header("Content-Type", "application/json");
|
||||||
request.set_body(configuration_object.to_string());
|
request.set_body(configuration_object.to_string());
|
||||||
let mut response = request_uds(&self.admin_api_socket_path, request.clone()).await.unwrap();
|
let mut response = request_uds(&self.admin_api_socket_path, request.clone()).await.unwrap();
|
||||||
|
@ -144,6 +144,7 @@ impl CaddyController {
|
||||||
StatusCode::NotFound => {
|
StatusCode::NotFound => {
|
||||||
// The site does not yet exist.
|
// The site does not yet exist.
|
||||||
|
|
||||||
|
request.set_method(Method::Post);
|
||||||
*request.url_mut() = Url::from_str("http://localhost/config/apps/http/servers/srv0/routes")?;
|
*request.url_mut() = Url::from_str("http://localhost/config/apps/http/servers/srv0/routes")?;
|
||||||
let mut response = request_uds(&self.admin_api_socket_path, request).await.unwrap();
|
let mut response = request_uds(&self.admin_api_socket_path, request).await.unwrap();
|
||||||
let status = response.status();
|
let status = response.status();
|
||||||
|
|
Loading…
Add table
Reference in a new issue