mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-10 07:47:53 +00:00
feat(api): update rust deps, move /private/meta endpoint to rust-api
This commit is contained in:
parent
f14c421e23
commit
e415c6704f
20 changed files with 1835 additions and 244 deletions
|
|
@ -1,13 +1,12 @@
|
|||
use std::time::{Duration, SystemTime};
|
||||
|
||||
use axum::http::{HeaderValue, StatusCode};
|
||||
use axum::{
|
||||
extract::State,
|
||||
http::Request,
|
||||
extract::{Request, State},
|
||||
middleware::{FromFnLayer, Next},
|
||||
response::Response,
|
||||
};
|
||||
use fred::{pool::RedisPool, prelude::LuaInterface, types::ReconnectPolicy, util::sha1_hash};
|
||||
use http::{HeaderValue, StatusCode};
|
||||
use metrics::increment_counter;
|
||||
use tracing::{debug, error, info, warn};
|
||||
|
||||
|
|
@ -55,10 +54,10 @@ pub fn ratelimiter<F, T>(f: F) -> FromFnLayer<F, Option<RedisPool>, T> {
|
|||
axum::middleware::from_fn_with_state(redis, f)
|
||||
}
|
||||
|
||||
pub async fn do_request_ratelimited<B>(
|
||||
pub async fn do_request_ratelimited(
|
||||
State(redis): State<Option<RedisPool>>,
|
||||
request: Request<B>,
|
||||
next: Next<B>,
|
||||
request: Request,
|
||||
next: Next,
|
||||
) -> Response {
|
||||
if let Some(redis) = redis {
|
||||
let headers = request.headers().clone();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue