Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ missing-docs-in-private-items = "warn"

[dependencies]
axum = { version = "0.8.4", default-features = false, features = [ "http1", "http2", "tokio", "tracing", "query" ] }
chrono = { version = "0.4.41", default-features = false, features = [ "serde", "now" ] }
chrono = { version = "0.4.42", default-features = false, features = [ "serde", "now" ] }
clap = { version = "4.5.41", features = ["derive"] }
eyre = "0.6.12"
futures = { version = "0.3.31", default-features = false, features = [ "alloc" ] }
Expand All @@ -34,6 +34,7 @@ rand = { version = "0.9.2", default-features = false, features = [ "thread_rng"
reqwest = { version = "0.12.22", features = ["stream", "json"] }
same-file = "1.0.6"
sarlacc = "0.1.4"
seize = "0.5.1"
# sarlacc = { path = "../sarlacc" }
serde = { version = "1.0.219", features = ["derive"] }
serde_json = "1.0.141"
Expand Down
20 changes: 3 additions & 17 deletions src/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ mod tests {
http::{Request, Uri, header},
response::IntoResponse,
};
use chrono::Utc;

use eyre::eyre;
use http_body_util::BodyExt;
use indoc::indoc;
Expand All @@ -500,10 +500,7 @@ mod tests {
use tower::{Service, ServiceExt};
use tower_http::catch_panic::ResponseForPanic;

use crate::{
stats::{TIMEZONE, UNKNOWN_ORIGIN},
webring::Webring,
};
use crate::{stats::UNKNOWN_ORIGIN, webring::Webring};

use super::{OriginUriLocation, PanicResponse, RouteError, create_router};

Expand Down Expand Up @@ -559,8 +556,6 @@ mod tests {
async fn index() {
let (router, webring, tmpfiles) = app().await;

let today = Utc::now().with_timezone(&TIMEZONE).date_naive();

// Request `/`
let res = router
.oneshot(
Expand All @@ -578,10 +573,7 @@ mod tests {
.unwrap();
assert_eq!("Hello homepage!", text);
assert_eq!(status, StatusCode::OK);
webring.assert_stat_entry(
(today, "kasad.com", "ring.purduehackers.com", "kasad.com"),
1,
);
webring.assert_stat_entry(("kasad.com", "ring.purduehackers.com", "kasad.com"), 1);

drop(tmpfiles);
}
Expand All @@ -590,8 +582,6 @@ mod tests {
async fn index_unknown_referer() {
let (router, webring, tmpfiles) = app().await;

let today = Utc::now().with_timezone(&TIMEZONE).date_naive();

let res = router
.oneshot(
Request::builder()
Expand All @@ -610,7 +600,6 @@ mod tests {
assert_eq!(status, StatusCode::OK);
webring.assert_stat_entry(
(
today,
UNKNOWN_ORIGIN.as_str(),
"ring.purduehackers.com",
UNKNOWN_ORIGIN.as_str(),
Expand All @@ -625,8 +614,6 @@ mod tests {
async fn visit() {
let (router, webring, tmpfiles) = app().await;

let today = Utc::now().with_timezone(&TIMEZONE).date_naive();

let res = router
.oneshot(
Request::builder()
Expand All @@ -644,7 +631,6 @@ mod tests {
assert_eq!(res.status(), StatusCode::SEE_OTHER);
webring.assert_stat_entry(
(
today,
"ring.purduehackers.com",
"clementine.viridian.page",
"ring.purduehackers.com",
Expand Down
Loading