mirror of
https://codeberg.org/slatian/service.echoip-slatecave.git
synced 2025-07-21 00:06:03 +02:00
WIP moved templating engine to mycelium
This commit is contained in:
12
src/view.rs
12
src/view.rs
@ -3,6 +3,8 @@ use axum::http::status::StatusCode;
|
||||
use axum::Json;
|
||||
use axum::response::IntoResponse;
|
||||
use axum::response::Response;
|
||||
use axum_extra::extract::cookie::Cookie;
|
||||
use axum_extra::extract::cookie;
|
||||
|
||||
use crate::DigResult;
|
||||
use crate::IpResult;
|
||||
@ -47,6 +49,16 @@ impl MycView<QuerySettings, ResponseFormat> for View {
|
||||
}
|
||||
}
|
||||
|
||||
fn get_cookie_header(&self, settings: &QuerySettings) -> Option<String> {
|
||||
Some(
|
||||
Cookie::build("dns_resolver",settings.dns_resolver_id.to_string())
|
||||
.path("/")
|
||||
.same_site(cookie::SameSite::Strict)
|
||||
.finish()
|
||||
.to_string()
|
||||
)
|
||||
}
|
||||
|
||||
fn get_api_response(self, settings: &QuerySettings) -> Response {
|
||||
match self {
|
||||
Self::Dig{result, ..} => {
|
||||
|
Reference in New Issue
Block a user