Compare commits
1 Commits
bugfix/api
...
chore/repo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9c098c8a73 |
2
backend/Cargo.lock
generated
2
backend/Cargo.lock
generated
@@ -1470,7 +1470,7 @@ checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mangalord"
|
name = "mangalord"
|
||||||
version = "0.34.1"
|
version = "0.34.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"argon2",
|
"argon2",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "mangalord"
|
name = "mangalord"
|
||||||
version = "0.34.1"
|
version = "0.34.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
default-run = "mangalord"
|
default-run = "mangalord"
|
||||||
|
|
||||||
|
|||||||
@@ -230,24 +230,8 @@ async fn create_token(
|
|||||||
Json(input): Json<CreateTokenInput>,
|
Json(input): Json<CreateTokenInput>,
|
||||||
) -> AppResult<impl IntoResponse> {
|
) -> AppResult<impl IntoResponse> {
|
||||||
let name = input.name.trim();
|
let name = input.name.trim();
|
||||||
// Both arms use `ValidationFailed` (422 with field details) to
|
|
||||||
// match the structured-error shape `attach_tag` returns for the
|
|
||||||
// same kind of free-form-identifier validation. The other
|
|
||||||
// /auth/* handlers in this file use `InvalidInput` (400); the
|
|
||||||
// divergence is pre-existing and would warrant a project-wide
|
|
||||||
// pass to flip them all if the client side wants uniform per-
|
|
||||||
// field error rendering.
|
|
||||||
if name.is_empty() {
|
if name.is_empty() {
|
||||||
return Err(AppError::ValidationFailed {
|
return Err(AppError::InvalidInput("token name is required".into()));
|
||||||
message: "token name is required".into(),
|
|
||||||
details: serde_json::json!({ "name": "required" }),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if name.chars().count() > 64 {
|
|
||||||
return Err(AppError::ValidationFailed {
|
|
||||||
message: "token name too long".into(),
|
|
||||||
details: serde_json::json!({ "name": "max 64 characters" }),
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
let (raw, hash) = generate_token();
|
let (raw, hash) = generate_token();
|
||||||
let token = repo::api_token::create(&state.db, user.id, name, &hash).await?;
|
let token = repo::api_token::create(&state.db, user.id, name, &hash).await?;
|
||||||
|
|||||||
@@ -67,14 +67,7 @@ async fn create(
|
|||||||
// the foreign-key violation collapse into a generic 500.
|
// the foreign-key violation collapse into a generic 500.
|
||||||
repo::manga::get(&state.db, input.manga_id).await?;
|
repo::manga::get(&state.db, input.manga_id).await?;
|
||||||
if let Some(chapter_id) = input.chapter_id {
|
if let Some(chapter_id) = input.chapter_id {
|
||||||
let exists: Option<(Uuid,)> = sqlx::query_as(
|
if !repo::chapter::belongs_to_manga(&state.db, chapter_id, input.manga_id).await? {
|
||||||
"SELECT id FROM chapters WHERE id = $1 AND manga_id = $2",
|
|
||||||
)
|
|
||||||
.bind(chapter_id)
|
|
||||||
.bind(input.manga_id)
|
|
||||||
.fetch_optional(&state.db)
|
|
||||||
.await?;
|
|
||||||
if exists.is_none() {
|
|
||||||
return Err(AppError::NotFound);
|
return Err(AppError::NotFound);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -348,7 +348,6 @@ async fn attach_tag(
|
|||||||
Path(id): Path<Uuid>,
|
Path(id): Path<Uuid>,
|
||||||
Json(body): Json<AttachTagBody>,
|
Json(body): Json<AttachTagBody>,
|
||||||
) -> AppResult<(StatusCode, Json<TagRef>)> {
|
) -> AppResult<(StatusCode, Json<TagRef>)> {
|
||||||
validate_tag_name(&body.name)?;
|
|
||||||
if !repo::manga::exists(&state.db, id).await? {
|
if !repo::manga::exists(&state.db, id).await? {
|
||||||
return Err(AppError::NotFound);
|
return Err(AppError::NotFound);
|
||||||
}
|
}
|
||||||
@@ -395,27 +394,6 @@ async fn detach_tag(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Request-side validation for `POST /mangas/:id/tags` body. Mirrors
|
|
||||||
/// the repo-level cap in `repo::tag::upsert_by_name` (max 64 chars
|
|
||||||
/// after trim) but surfaces the failure at the handler boundary with
|
|
||||||
/// the same envelope shape other validations use.
|
|
||||||
fn validate_tag_name(name: &str) -> AppResult<()> {
|
|
||||||
let trimmed = name.trim();
|
|
||||||
if trimmed.is_empty() {
|
|
||||||
return Err(AppError::ValidationFailed {
|
|
||||||
message: "tag name cannot be empty".into(),
|
|
||||||
details: json!({ "name": "required" }),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if trimmed.chars().count() > 64 {
|
|
||||||
return Err(AppError::ValidationFailed {
|
|
||||||
message: "tag name too long".into(),
|
|
||||||
details: json!({ "name": "max 64 characters" }),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn validate_new_manga(input: &NewManga) -> AppResult<()> {
|
fn validate_new_manga(input: &NewManga) -> AppResult<()> {
|
||||||
if input.title.trim().is_empty() {
|
if input.title.trim().is_empty() {
|
||||||
return Err(AppError::ValidationFailed {
|
return Err(AppError::ValidationFailed {
|
||||||
|
|||||||
@@ -304,16 +304,7 @@ impl ChapterDispatcher for RealChapterDispatcher {
|
|||||||
chapter_id,
|
chapter_id,
|
||||||
source_chapter_key: _,
|
source_chapter_key: _,
|
||||||
} => {
|
} => {
|
||||||
// Look up manga_id + source_url for this chapter.
|
let row = repo::chapter::dispatch_target(&self.db, chapter_id)
|
||||||
let row: Option<(uuid::Uuid, String)> = sqlx::query_as(
|
|
||||||
"SELECT c.manga_id, cs.source_url \
|
|
||||||
FROM chapters c \
|
|
||||||
JOIN chapter_sources cs ON cs.chapter_id = c.id \
|
|
||||||
WHERE c.id = $1 \
|
|
||||||
LIMIT 1",
|
|
||||||
)
|
|
||||||
.bind(chapter_id)
|
|
||||||
.fetch_optional(&self.db)
|
|
||||||
.await
|
.await
|
||||||
.context("look up chapter for dispatch")?;
|
.context("look up chapter for dispatch")?;
|
||||||
let Some((manga_id, source_url)) = row else {
|
let Some((manga_id, source_url)) = row else {
|
||||||
|
|||||||
@@ -317,11 +317,7 @@ impl WorkerContext {
|
|||||||
// (because a force-refetch race or a job that was re-enqueued
|
// (because a force-refetch race or a job that was re-enqueued
|
||||||
// after a previous one finished), ack done without re-fetching.
|
// after a previous one finished), ack done without re-fetching.
|
||||||
if let JobPayload::SyncChapterContent { chapter_id, .. } = &lease.payload {
|
if let JobPayload::SyncChapterContent { chapter_id, .. } = &lease.payload {
|
||||||
let page_count: Option<i32> = sqlx::query_scalar(
|
let page_count = crate::repo::chapter::page_count(&self.pool, *chapter_id)
|
||||||
"SELECT page_count FROM chapters WHERE id = $1",
|
|
||||||
)
|
|
||||||
.bind(chapter_id)
|
|
||||||
.fetch_optional(&self.pool)
|
|
||||||
.await
|
.await
|
||||||
.ok()
|
.ok()
|
||||||
.flatten();
|
.flatten();
|
||||||
|
|||||||
@@ -24,3 +24,4 @@ pub mod pipeline;
|
|||||||
pub mod rate_limit;
|
pub mod rate_limit;
|
||||||
pub mod session;
|
pub mod session;
|
||||||
pub mod source;
|
pub mod source;
|
||||||
|
pub mod url_utils;
|
||||||
|
|||||||
@@ -427,11 +427,7 @@ async fn download_and_store_cover(
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn origin_of(url: &str) -> Option<String> {
|
use crate::crawler::url_utils::origin_of;
|
||||||
let (scheme, rest) = url.split_once("://")?;
|
|
||||||
let host = rest.split('/').next()?;
|
|
||||||
Some(format!("{scheme}://{host}"))
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
|||||||
@@ -98,15 +98,9 @@ impl HostRateLimiters {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Extract the host (no port) from a URL string. Returns `None` for
|
// `host_of` was duplicated across session/rate_limit/pipeline; the
|
||||||
/// inputs without a `scheme://host` shape — those would never have
|
// canonical version now lives in `crawler::url_utils`.
|
||||||
/// reached the network layer anyway.
|
use crate::crawler::url_utils::host_of;
|
||||||
fn host_of(url: &str) -> Option<String> {
|
|
||||||
let after_scheme = url.split_once("://")?.1;
|
|
||||||
let host_with_port = after_scheme.split('/').next()?;
|
|
||||||
let host = host_with_port.rsplit_once(':').map_or(host_with_port, |(h, _)| h);
|
|
||||||
(!host.is_empty()).then(|| host.to_ascii_lowercase())
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
|||||||
@@ -42,36 +42,9 @@ pub enum SessionProbe {
|
|||||||
Transient,
|
Transient,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Compute the cookie domain (e.g. `.example.com`) from a start URL.
|
/// Re-export so existing callers keep working after the helper moved
|
||||||
/// The leading dot makes the cookie cover every subdomain — the source
|
/// to `crawler::url_utils`. The body lives there.
|
||||||
/// often redirects between `www.` and other prefixes mid-crawl, and a
|
pub use crate::crawler::url_utils::registrable_domain;
|
||||||
/// host-only cookie would silently drop on the cross-subdomain hop.
|
|
||||||
///
|
|
||||||
/// Caveat: this takes the last two dot-labels, which is wrong for
|
|
||||||
/// multi-part TLDs (`.co.uk`, `.com.br` would resolve to `.co.uk` and
|
|
||||||
/// attach to every site on `.co.uk`). For those, the operator should
|
|
||||||
/// override via `CRAWLER_COOKIE_DOMAIN` rather than relying on this
|
|
||||||
/// function — pulling in the Public Suffix List for one knob isn't
|
|
||||||
/// worth it yet.
|
|
||||||
pub fn registrable_domain(url: &str) -> Option<String> {
|
|
||||||
let after_scheme = url.split_once("://")?.1;
|
|
||||||
let host_with_port = after_scheme.split('/').next()?;
|
|
||||||
let host = host_with_port
|
|
||||||
.rsplit_once(':')
|
|
||||||
.map_or(host_with_port, |(h, _)| h)
|
|
||||||
.to_ascii_lowercase();
|
|
||||||
if host.is_empty() {
|
|
||||||
return None;
|
|
||||||
}
|
|
||||||
let labels: Vec<&str> = host.split('.').filter(|l| !l.is_empty()).collect();
|
|
||||||
if labels.len() < 2 {
|
|
||||||
// Bare hostname (e.g. `localhost`) — return as-is, no leading
|
|
||||||
// dot. Setting `.localhost` as cookie domain is invalid.
|
|
||||||
return Some(host);
|
|
||||||
}
|
|
||||||
let registrable = &labels[labels.len() - 2..];
|
|
||||||
Some(format!(".{}", registrable.join(".")))
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Inject the PHPSESSID cookie into the browser's cookie store for the
|
/// Inject the PHPSESSID cookie into the browser's cookie store for the
|
||||||
/// catalog domain. Must be called before any navigation that depends on
|
/// catalog domain. Must be called before any navigation that depends on
|
||||||
@@ -192,44 +165,8 @@ async fn fetch_probe_html(browser: &Browser, probe_url: &str) -> anyhow::Result<
|
|||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
#[test]
|
// registrable_domain tests live in crawler::url_utils now —
|
||||||
fn registrable_domain_strips_subdomain() {
|
// it's the canonical home for that helper.
|
||||||
assert_eq!(
|
|
||||||
registrable_domain("https://www.target-site.com/manga/foo/").as_deref(),
|
|
||||||
Some(".target-site.com")
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
registrable_domain("https://m.example.org").as_deref(),
|
|
||||||
Some(".example.org")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn registrable_domain_keeps_two_label_host() {
|
|
||||||
assert_eq!(
|
|
||||||
registrable_domain("https://example.com/").as_deref(),
|
|
||||||
Some(".example.com")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn registrable_domain_handles_port() {
|
|
||||||
assert_eq!(
|
|
||||||
registrable_domain("http://www.foo.bar:8080/x").as_deref(),
|
|
||||||
Some(".foo.bar")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn registrable_domain_bare_hostname_no_leading_dot() {
|
|
||||||
// .localhost would be invalid as a cookie Domain.
|
|
||||||
assert_eq!(registrable_domain("http://localhost:5173").as_deref(), Some("localhost"));
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn registrable_domain_returns_none_for_garbage() {
|
|
||||||
assert!(registrable_domain("not a url").is_none());
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn classify_probe_ok_when_logo_and_avatar_present() {
|
fn classify_probe_ok_when_logo_and_avatar_present() {
|
||||||
|
|||||||
194
backend/src/crawler/url_utils.rs
Normal file
194
backend/src/crawler/url_utils.rs
Normal file
@@ -0,0 +1,194 @@
|
|||||||
|
//! Centralised URL helpers for the crawler subsystem.
|
||||||
|
//!
|
||||||
|
//! Three near-identical hand-rolled URL parsers used to live in
|
||||||
|
//! `crawler::session`, `crawler::rate_limit`, and `crawler::pipeline`
|
||||||
|
//! respectively, each with subtly different edge-case behaviour
|
||||||
|
//! around port handling and IPv6 literals. They're consolidated here
|
||||||
|
//! so the divergence can't drift again.
|
||||||
|
//!
|
||||||
|
//! The hand-rolled implementations are kept intentionally — they
|
||||||
|
//! preserve the exact semantics every existing test pins. A future
|
||||||
|
//! refactor can switch to `reqwest::Url` if it can be done without
|
||||||
|
//! changing those semantics.
|
||||||
|
|
||||||
|
/// Lowercased host (no port). Returns `None` for inputs without a
|
||||||
|
/// `scheme://host` shape — those would never have reached the network
|
||||||
|
/// layer anyway. Used by the per-host rate limiter as its bucket key.
|
||||||
|
///
|
||||||
|
/// IPv6 literals are kept in their `[::1]` bracketed form so the
|
||||||
|
/// `rsplit_once(':')` port-stripping logic doesn't split inside the
|
||||||
|
/// address (e.g. `https://[::1]/foo` used to return `"[:"` because
|
||||||
|
/// the rightmost `:` is inside the literal). Buckets keyed by
|
||||||
|
/// `[::1]` vs `::1` are still uniquely-per-host; the brackets are
|
||||||
|
/// cosmetic.
|
||||||
|
pub fn host_of(url: &str) -> Option<String> {
|
||||||
|
let after_scheme = url.split_once("://")?.1;
|
||||||
|
let host_with_port = after_scheme.split('/').next()?;
|
||||||
|
let host = if host_with_port.starts_with('[') {
|
||||||
|
// IPv6 literal: keep through the closing bracket. There may
|
||||||
|
// be a trailing `:port` after `]`; strip only that.
|
||||||
|
match host_with_port.rfind(']') {
|
||||||
|
Some(end) => &host_with_port[..=end],
|
||||||
|
None => host_with_port,
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Hostnames and IPv4 literals: trailing `:port` (if any) is
|
||||||
|
// after the last `:`.
|
||||||
|
host_with_port
|
||||||
|
.rsplit_once(':')
|
||||||
|
.map_or(host_with_port, |(h, _)| h)
|
||||||
|
};
|
||||||
|
(!host.is_empty()).then(|| host.to_ascii_lowercase())
|
||||||
|
}
|
||||||
|
|
||||||
|
/// `scheme://host` with no path or port stripping. Used by the metadata
|
||||||
|
/// pass to seed `sources.base_url` from `CRAWLER_START_URL`.
|
||||||
|
pub fn origin_of(url: &str) -> Option<String> {
|
||||||
|
let (scheme, rest) = url.split_once("://")?;
|
||||||
|
let host = rest.split('/').next()?;
|
||||||
|
Some(format!("{scheme}://{host}"))
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Approximate registrable-domain calculation: take the last two
|
||||||
|
/// dot-labels of the host, prefix with `.`. Used to set a parent-
|
||||||
|
/// domain cookie so the catalog's `www.` / `m.` redirects don't drop
|
||||||
|
/// the cookie mid-crawl.
|
||||||
|
///
|
||||||
|
/// Caveat: wrong for multi-part TLDs (`.co.uk`, `.com.br`). The
|
||||||
|
/// operator can override via `CRAWLER_COOKIE_DOMAIN`; pulling in the
|
||||||
|
/// Public Suffix List for one knob isn't worth it yet.
|
||||||
|
///
|
||||||
|
/// Bare hostnames (e.g. `localhost`) return the host as-is, with no
|
||||||
|
/// leading dot — setting `.localhost` as a cookie domain is invalid.
|
||||||
|
/// IPv6 literals (e.g. `[::1]`) are returned bracketed and unchanged;
|
||||||
|
/// the browser will reject them as a cookie `Domain` anyway, but the
|
||||||
|
/// representation stays sensible. Same `starts_with('[')` branch as
|
||||||
|
/// [`host_of`] for consistent IPv6 handling across the module.
|
||||||
|
pub fn registrable_domain(url: &str) -> Option<String> {
|
||||||
|
let after_scheme = url.split_once("://")?.1;
|
||||||
|
let host_with_port = after_scheme.split('/').next()?;
|
||||||
|
let host_str = if host_with_port.starts_with('[') {
|
||||||
|
// IPv6 literal: keep through the closing bracket; an optional
|
||||||
|
// `:port` follows `]`.
|
||||||
|
match host_with_port.rfind(']') {
|
||||||
|
Some(end) => &host_with_port[..=end],
|
||||||
|
None => host_with_port,
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
host_with_port
|
||||||
|
.rsplit_once(':')
|
||||||
|
.map_or(host_with_port, |(h, _)| h)
|
||||||
|
};
|
||||||
|
let host = host_str.to_ascii_lowercase();
|
||||||
|
if host.is_empty() {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
let labels: Vec<&str> = host.split('.').filter(|l| !l.is_empty()).collect();
|
||||||
|
if labels.len() < 2 {
|
||||||
|
return Some(host);
|
||||||
|
}
|
||||||
|
let registrable = &labels[labels.len() - 2..];
|
||||||
|
Some(format!(".{}", registrable.join(".")))
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn host_of_strips_port_and_lowercases() {
|
||||||
|
assert_eq!(
|
||||||
|
host_of("https://CDN.Example.com:443/x").as_deref(),
|
||||||
|
Some("cdn.example.com")
|
||||||
|
);
|
||||||
|
assert_eq!(host_of("http://localhost/").as_deref(), Some("localhost"));
|
||||||
|
assert_eq!(host_of("not a url"), None);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn host_of_keeps_bracketed_ipv6_literal_intact() {
|
||||||
|
// Regression: the old impl rsplit_once(':')'d the IPv6 address,
|
||||||
|
// returning "[:" instead of "[::1]". A real IPv6 source would
|
||||||
|
// silently get a wrong rate-limit bucket key.
|
||||||
|
assert_eq!(host_of("https://[::1]/").as_deref(), Some("[::1]"));
|
||||||
|
assert_eq!(host_of("https://[::1]:8080/").as_deref(), Some("[::1]"));
|
||||||
|
assert_eq!(
|
||||||
|
host_of("https://[2001:db8::1]/foo").as_deref(),
|
||||||
|
Some("[2001:db8::1]")
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
host_of("https://[2001:db8::1]:443/foo").as_deref(),
|
||||||
|
Some("[2001:db8::1]")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn origin_of_returns_scheme_and_host() {
|
||||||
|
assert_eq!(
|
||||||
|
origin_of("https://example.com/some/path?q=1").as_deref(),
|
||||||
|
Some("https://example.com")
|
||||||
|
);
|
||||||
|
assert_eq!(origin_of("garbage"), None);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn registrable_domain_strips_subdomain() {
|
||||||
|
assert_eq!(
|
||||||
|
registrable_domain("https://www.target-site.com/manga/foo/").as_deref(),
|
||||||
|
Some(".target-site.com")
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
registrable_domain("https://m.example.org").as_deref(),
|
||||||
|
Some(".example.org")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn registrable_domain_keeps_two_label_host() {
|
||||||
|
assert_eq!(
|
||||||
|
registrable_domain("https://example.com/").as_deref(),
|
||||||
|
Some(".example.com")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn registrable_domain_handles_port() {
|
||||||
|
assert_eq!(
|
||||||
|
registrable_domain("http://www.foo.bar:8080/x").as_deref(),
|
||||||
|
Some(".foo.bar")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn registrable_domain_bare_hostname_no_leading_dot() {
|
||||||
|
assert_eq!(
|
||||||
|
registrable_domain("http://localhost:5173").as_deref(),
|
||||||
|
Some("localhost")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn registrable_domain_returns_none_for_garbage() {
|
||||||
|
assert!(registrable_domain("not a url").is_none());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn registrable_domain_keeps_bracketed_ipv6_literal_intact() {
|
||||||
|
// Symmetric with host_of's IPv6 fix. The cookie-domain code
|
||||||
|
// won't accept an IP as a `Domain` value, but the function
|
||||||
|
// should at least return a sensible representation rather
|
||||||
|
// than the truncated `"[:"` the old port-stripper produced.
|
||||||
|
assert_eq!(
|
||||||
|
registrable_domain("https://[::1]/").as_deref(),
|
||||||
|
Some("[::1]")
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
registrable_domain("https://[::1]:8080/").as_deref(),
|
||||||
|
Some("[::1]")
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
registrable_domain("https://[2001:db8::1]/foo").as_deref(),
|
||||||
|
Some("[2001:db8::1]")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -99,6 +99,11 @@ pub async fn list(
|
|||||||
/// Atomically replace the set of authors on a manga. Caller passes a
|
/// Atomically replace the set of authors on a manga. Caller passes a
|
||||||
/// `&mut PgConnection` (`&mut *tx` works) so the delete+upserts run in
|
/// `&mut PgConnection` (`&mut *tx` works) so the delete+upserts run in
|
||||||
/// one transaction with whatever called us.
|
/// one transaction with whatever called us.
|
||||||
|
///
|
||||||
|
/// Note: `crawler::repo::sync_authors` does a similar replace with the
|
||||||
|
/// same semantics on names. The duplication is intentional — handler
|
||||||
|
/// callers want the `Vec<AuthorRef>` for the API response; the
|
||||||
|
/// crawler doesn't need it and stays inside its own transaction.
|
||||||
pub async fn set_for_manga(
|
pub async fn set_for_manga(
|
||||||
conn: &mut PgConnection,
|
conn: &mut PgConnection,
|
||||||
manga_id: Uuid,
|
manga_id: Uuid,
|
||||||
|
|||||||
@@ -29,9 +29,9 @@ pub async fn create(
|
|||||||
|
|
||||||
match result {
|
match result {
|
||||||
Ok(b) => Ok(b),
|
Ok(b) => Ok(b),
|
||||||
Err(e) if is_unique_violation(&e) => Err(AppError::Conflict(
|
Err(sqlx::Error::Database(ref db_err)) if db_err.is_unique_violation() => Err(
|
||||||
"bookmark already exists for this manga/chapter".into(),
|
AppError::Conflict("bookmark already exists for this manga/chapter".into()),
|
||||||
)),
|
),
|
||||||
Err(e) => Err(AppError::Database(e)),
|
Err(e) => Err(AppError::Database(e)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -97,10 +97,3 @@ pub async fn delete(pool: &PgPool, id: Uuid) -> AppResult<()> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_unique_violation(err: &sqlx::Error) -> bool {
|
|
||||||
if let sqlx::Error::Database(db_err) = err {
|
|
||||||
db_err.code().as_deref() == Some("23505")
|
|
||||||
} else {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ use sqlx::{PgExecutor, PgPool};
|
|||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
|
|
||||||
use crate::domain::Chapter;
|
use crate::domain::Chapter;
|
||||||
use crate::error::{AppError, AppResult};
|
use crate::error::AppResult;
|
||||||
|
|
||||||
pub async fn list_for_manga(
|
pub async fn list_for_manga(
|
||||||
pool: &PgPool,
|
pool: &PgPool,
|
||||||
@@ -62,10 +62,9 @@ pub async fn find_by_id_in_manga(
|
|||||||
///
|
///
|
||||||
/// Chapter identity is the row UUID; the same (manga_id, number)
|
/// Chapter identity is the row UUID; the same (manga_id, number)
|
||||||
/// combination can repeat (multiple translations, re-uploads). The
|
/// combination can repeat (multiple translations, re-uploads). The
|
||||||
/// `is_unique_violation` branch below is a defensive holdover from
|
/// 0013 migration dropped the (manga_id, number) UNIQUE, so duplicate
|
||||||
/// 0001's (manga_id, number) UNIQUE — it can no longer fire under
|
/// inserts succeed by design. If a future migration re-adds any
|
||||||
/// normal operation, but we surface a clean 409 if a future migration
|
/// uniqueness, surface a 409 by adding a unique-violation arm here.
|
||||||
/// re-adds any chapter uniqueness.
|
|
||||||
pub async fn create<'e, E: PgExecutor<'e>>(
|
pub async fn create<'e, E: PgExecutor<'e>>(
|
||||||
executor: E,
|
executor: E,
|
||||||
manga_id: Uuid,
|
manga_id: Uuid,
|
||||||
@@ -73,7 +72,7 @@ pub async fn create<'e, E: PgExecutor<'e>>(
|
|||||||
title: Option<&str>,
|
title: Option<&str>,
|
||||||
uploaded_by: Option<Uuid>,
|
uploaded_by: Option<Uuid>,
|
||||||
) -> AppResult<Chapter> {
|
) -> AppResult<Chapter> {
|
||||||
let result = sqlx::query_as::<_, Chapter>(
|
let row = sqlx::query_as::<_, Chapter>(
|
||||||
r#"
|
r#"
|
||||||
INSERT INTO chapters (manga_id, number, title, uploaded_by)
|
INSERT INTO chapters (manga_id, number, title, uploaded_by)
|
||||||
VALUES ($1, $2, $3, $4)
|
VALUES ($1, $2, $3, $4)
|
||||||
@@ -85,15 +84,58 @@ pub async fn create<'e, E: PgExecutor<'e>>(
|
|||||||
.bind(title)
|
.bind(title)
|
||||||
.bind(uploaded_by)
|
.bind(uploaded_by)
|
||||||
.fetch_one(executor)
|
.fetch_one(executor)
|
||||||
.await;
|
.await?;
|
||||||
|
Ok(row)
|
||||||
match result {
|
|
||||||
Ok(c) => Ok(c),
|
|
||||||
Err(e) if is_unique_violation(&e) => Err(AppError::Conflict(format!(
|
|
||||||
"chapter {number} conflicts with an existing chapter for this manga"
|
|
||||||
))),
|
|
||||||
Err(e) => Err(AppError::Database(e)),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Cross-link guard for `POST /bookmarks`: the bookmarks FK accepts
|
||||||
|
/// any valid chapter id, but a chapter must belong to the bookmark's
|
||||||
|
/// manga or the bookmark would dangle on a foreign manga. Handlers
|
||||||
|
/// call this before the insert and surface `NotFound` when it
|
||||||
|
/// returns `false`.
|
||||||
|
pub async fn belongs_to_manga(
|
||||||
|
pool: &PgPool,
|
||||||
|
chapter_id: Uuid,
|
||||||
|
manga_id: Uuid,
|
||||||
|
) -> AppResult<bool> {
|
||||||
|
let (exists,): (bool,) = sqlx::query_as(
|
||||||
|
"SELECT EXISTS(SELECT 1 FROM chapters WHERE id = $1 AND manga_id = $2)",
|
||||||
|
)
|
||||||
|
.bind(chapter_id)
|
||||||
|
.bind(manga_id)
|
||||||
|
.fetch_one(pool)
|
||||||
|
.await?;
|
||||||
|
Ok(exists)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Read just the page_count for a chapter. Used by the crawler
|
||||||
|
/// daemon's consumer-side dedup safety net so it can ack-done a job
|
||||||
|
/// whose chapter has already been fetched by a racing worker.
|
||||||
|
pub async fn page_count(pool: &PgPool, id: Uuid) -> sqlx::Result<Option<i32>> {
|
||||||
|
sqlx::query_scalar("SELECT page_count FROM chapters WHERE id = $1")
|
||||||
|
.bind(id)
|
||||||
|
.fetch_optional(pool)
|
||||||
|
.await
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Look up the manga_id + most recent source_url for a chapter. Used
|
||||||
|
/// by the daemon's chapter dispatcher to resolve the URL it needs to
|
||||||
|
/// hand to `content::sync_chapter_content`. Returns `None` if the
|
||||||
|
/// chapter (or its source row) is gone.
|
||||||
|
pub async fn dispatch_target(
|
||||||
|
pool: &PgPool,
|
||||||
|
chapter_id: Uuid,
|
||||||
|
) -> sqlx::Result<Option<(Uuid, String)>> {
|
||||||
|
sqlx::query_as(
|
||||||
|
"SELECT c.manga_id, cs.source_url \
|
||||||
|
FROM chapters c \
|
||||||
|
JOIN chapter_sources cs ON cs.chapter_id = c.id \
|
||||||
|
WHERE c.id = $1 \
|
||||||
|
LIMIT 1",
|
||||||
|
)
|
||||||
|
.bind(chapter_id)
|
||||||
|
.fetch_optional(pool)
|
||||||
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn set_page_count<'e, E: PgExecutor<'e>>(
|
pub async fn set_page_count<'e, E: PgExecutor<'e>>(
|
||||||
@@ -109,10 +151,3 @@ pub async fn set_page_count<'e, E: PgExecutor<'e>>(
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_unique_violation(err: &sqlx::Error) -> bool {
|
|
||||||
if let sqlx::Error::Database(db_err) = err {
|
|
||||||
db_err.code().as_deref() == Some("23505")
|
|
||||||
} else {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -61,6 +61,11 @@ pub async fn load_for_mangas(
|
|||||||
/// FK constraint would reject them, so we filter upstream rather than
|
/// FK constraint would reject them, so we filter upstream rather than
|
||||||
/// surface a 500 here. (The API layer validates the set against
|
/// surface a 500 here. (The API layer validates the set against
|
||||||
/// `list_all` first.)
|
/// `list_all` first.)
|
||||||
|
///
|
||||||
|
/// Note: `crawler::repo::sync_genres` does a similar replace, but by
|
||||||
|
/// *name* and with auto-create of unseen genres — the crawler can't
|
||||||
|
/// validate against the curated vocabulary on its own. Both paths are
|
||||||
|
/// intentional; don't merge them without preserving that semantic.
|
||||||
pub async fn set_for_manga(
|
pub async fn set_for_manga(
|
||||||
conn: &mut PgConnection,
|
conn: &mut PgConnection,
|
||||||
manga_id: Uuid,
|
manga_id: Uuid,
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ pub async fn create(pool: &PgPool, username: &str, password_hash: &str) -> AppRe
|
|||||||
|
|
||||||
match result {
|
match result {
|
||||||
Ok(user) => Ok(user),
|
Ok(user) => Ok(user),
|
||||||
Err(e) if is_unique_violation(&e) => {
|
Err(sqlx::Error::Database(ref db_err)) if db_err.is_unique_violation() => {
|
||||||
Err(AppError::Conflict("username is already taken".into()))
|
Err(AppError::Conflict("username is already taken".into()))
|
||||||
}
|
}
|
||||||
Err(e) => Err(AppError::Database(e)),
|
Err(e) => Err(AppError::Database(e)),
|
||||||
@@ -56,10 +56,3 @@ pub async fn find_by_id(pool: &PgPool, id: Uuid) -> AppResult<Option<User>> {
|
|||||||
Ok(row)
|
Ok(row)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn is_unique_violation(err: &sqlx::Error) -> bool {
|
|
||||||
if let sqlx::Error::Database(db_err) = err {
|
|
||||||
db_err.code().as_deref() == Some("23505")
|
|
||||||
} else {
|
|
||||||
false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -16,13 +16,6 @@ impl LocalStorage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn resolve(&self, key: &str) -> Result<PathBuf, StorageError> {
|
fn resolve(&self, key: &str) -> Result<PathBuf, StorageError> {
|
||||||
// NUL bytes are rejected by the Linux syscall layer, but the
|
|
||||||
// error surfaces as an opaque IO failure rather than the
|
|
||||||
// explicit `BadKey` the rest of the contract uses. Catch it
|
|
||||||
// here so the error path is consistent.
|
|
||||||
if key.contains('\0') {
|
|
||||||
return Err(StorageError::BadKey);
|
|
||||||
}
|
|
||||||
let key = key.trim_start_matches('/');
|
let key = key.trim_start_matches('/');
|
||||||
if key.is_empty() {
|
if key.is_empty() {
|
||||||
return Err(StorageError::BadKey);
|
return Err(StorageError::BadKey);
|
||||||
@@ -121,9 +114,6 @@ mod tests {
|
|||||||
assert!(matches!(s.get(".").await, Err(StorageError::BadKey)));
|
assert!(matches!(s.get(".").await, Err(StorageError::BadKey)));
|
||||||
// Empty segment via doubled slash.
|
// Empty segment via doubled slash.
|
||||||
assert!(matches!(s.get("a//b").await, Err(StorageError::BadKey)));
|
assert!(matches!(s.get("a//b").await, Err(StorageError::BadKey)));
|
||||||
// NUL byte (rejected explicitly so callers see BadKey rather
|
|
||||||
// than an opaque IO error from the kernel).
|
|
||||||
assert!(matches!(s.put("a\0b", b"x").await, Err(StorageError::BadKey)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
|
|||||||
@@ -581,27 +581,3 @@ async fn delete_unknown_token_is_404(pool: PgPool) {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
assert_eq!(resp.status(), StatusCode::NOT_FOUND);
|
assert_eq!(resp.status(), StatusCode::NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Bot token names are user-supplied free-form strings; a 10 MB name
|
|
||||||
/// was accepted before. Cap at 64 chars to match the other free-form
|
|
||||||
/// identifier caps (tags, collection names). The response uses
|
|
||||||
/// `ValidationFailed` (422 with per-field details) so clients can
|
|
||||||
/// render the same shape they already handle for `attach_tag`.
|
|
||||||
#[sqlx::test(migrations = "./migrations")]
|
|
||||||
async fn create_token_rejects_name_over_64_chars(pool: PgPool) {
|
|
||||||
let h = common::harness(pool);
|
|
||||||
let (_, cookie) = common::register_user(&h.app).await;
|
|
||||||
let resp = h
|
|
||||||
.app
|
|
||||||
.oneshot(common::post_json_with_cookie(
|
|
||||||
"/api/v1/auth/tokens",
|
|
||||||
json!({ "name": "x".repeat(65) }),
|
|
||||||
&cookie,
|
|
||||||
))
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
assert_eq!(resp.status(), StatusCode::UNPROCESSABLE_ENTITY);
|
|
||||||
let body = common::body_json(resp).await;
|
|
||||||
assert_eq!(body["error"]["code"], "validation_failed");
|
|
||||||
assert!(body["error"]["details"]["name"].is_string());
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -59,31 +59,6 @@ async fn reattach_same_tag_is_idempotent_and_returns_200(pool: PgPool) {
|
|||||||
assert_eq!(second.status(), StatusCode::OK);
|
assert_eq!(second.status(), StatusCode::OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Tag names over 64 chars are rejected at the handler boundary. The
|
|
||||||
/// repo enforces the same cap, but doing it at the handler keeps the
|
|
||||||
/// envelope consistent with the other validation paths
|
|
||||||
/// (username, collection name, etc.).
|
|
||||||
#[sqlx::test(migrations = "./migrations")]
|
|
||||||
async fn attach_rejects_tag_name_over_64_chars(pool: PgPool) {
|
|
||||||
let h = common::harness(pool);
|
|
||||||
let (_, cookie) = common::register_user(&h.app).await;
|
|
||||||
let manga_id = common::seed_manga_via_api(&h.app, &cookie, "Berserk").await;
|
|
||||||
|
|
||||||
let long_name: String = "x".repeat(65);
|
|
||||||
let resp = h
|
|
||||||
.app
|
|
||||||
.oneshot(common::post_json_with_cookie(
|
|
||||||
&format!("/api/v1/mangas/{manga_id}/tags"),
|
|
||||||
json!({ "name": long_name }),
|
|
||||||
&cookie,
|
|
||||||
))
|
|
||||||
.await
|
|
||||||
.unwrap();
|
|
||||||
assert_eq!(resp.status(), StatusCode::UNPROCESSABLE_ENTITY);
|
|
||||||
let body = common::body_json(resp).await;
|
|
||||||
assert_eq!(body["error"]["code"], "validation_failed");
|
|
||||||
}
|
|
||||||
|
|
||||||
#[sqlx::test(migrations = "./migrations")]
|
#[sqlx::test(migrations = "./migrations")]
|
||||||
async fn tag_names_dedup_case_insensitively(pool: PgPool) {
|
async fn tag_names_dedup_case_insensitively(pool: PgPool) {
|
||||||
let h = common::harness(pool);
|
let h = common::harness(pool);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "mangalord-frontend",
|
"name": "mangalord-frontend",
|
||||||
"version": "0.34.1",
|
"version": "0.34.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -94,11 +94,6 @@ describe('auth api client', () => {
|
|||||||
expect(url).toMatch(/\/v1\/auth\/logout$/);
|
expect(url).toMatch(/\/v1\/auth\/logout$/);
|
||||||
const init = fetchSpy.mock.calls[0][1] as RequestInit;
|
const init = fetchSpy.mock.calls[0][1] as RequestInit;
|
||||||
expect(init.method).toBe('POST');
|
expect(init.method).toBe('POST');
|
||||||
// Consistent content-type for all mutation requests, matching
|
|
||||||
// the rest of the module — axum doesn't require it but the
|
|
||||||
// header keeps the request style uniform.
|
|
||||||
const headers = new Headers(init.headers);
|
|
||||||
expect(headers.get('content-type')).toBe('application/json');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('me returns the user on 200', async () => {
|
it('me returns the user on 200', async () => {
|
||||||
|
|||||||
@@ -32,14 +32,7 @@ export async function login(creds: Credentials): Promise<User> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function logout(): Promise<void> {
|
export async function logout(): Promise<void> {
|
||||||
await request<void>('/v1/auth/logout', {
|
await request<void>('/v1/auth/logout', { method: 'POST' });
|
||||||
method: 'POST',
|
|
||||||
// Consistent with the other POST/PATCH helpers in this module.
|
|
||||||
// axum doesn't require it (no body), but keeping the header
|
|
||||||
// on every mutation request avoids the false-flag in logs and
|
|
||||||
// matches the project's style.
|
|
||||||
headers: { 'content-type': 'application/json' }
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ChangePassword = {
|
export type ChangePassword = {
|
||||||
|
|||||||
@@ -350,24 +350,30 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flush read-progress as the tab is closing. A plain `fetch()`
|
* `fetch()` initiated during `pagehide` / `beforeunload` is
|
||||||
* during `pagehide` / `beforeunload` is cancelled by every
|
* cancelled by every browser by default. `sendBeacon` is the
|
||||||
* browser; `fetch(..., { keepalive: true })` is the supported
|
* supported way to ship a small payload during unload — it's
|
||||||
* escape hatch and survives the close.
|
* guaranteed to survive even if the tab is closing. Failure here
|
||||||
*
|
* is silent because the API is fire-and-forget.
|
||||||
* `sendBeacon` would be the textbook alternative, but it's
|
|
||||||
* POST-only and `/me/read-progress` takes PUT — so a beacon
|
|
||||||
* always 405s, adds server-log noise, then falls through to this
|
|
||||||
* same keepalive path anyway. The beacon was dropped; the
|
|
||||||
* keepalive fetch is the only path.
|
|
||||||
*/
|
*/
|
||||||
function flushFinalProgress() {
|
function beaconFinalProgress() {
|
||||||
if (!session.user) return;
|
if (!session.user) return;
|
||||||
const body = JSON.stringify({
|
const body = JSON.stringify({
|
||||||
manga_id: manga.id,
|
manga_id: manga.id,
|
||||||
chapter_id: chapter.id,
|
chapter_id: chapter.id,
|
||||||
page: progressPage
|
page: progressPage
|
||||||
});
|
});
|
||||||
|
const blob = new Blob([body], { type: 'application/json' });
|
||||||
|
// sendBeacon only supports POST — the server's PUT route is
|
||||||
|
// strict on method. The dedicated POST alias is omitted; in
|
||||||
|
// practice the in-app navigation path (back-link, chapter
|
||||||
|
// links) already covers the common-case unmount via the
|
||||||
|
// onDestroy fetch. Fall through to fetch+keepalive for browser
|
||||||
|
// implementations that don't honor sendBeacon for this endpoint.
|
||||||
|
try {
|
||||||
|
const ok = navigator.sendBeacon('/api/v1/me/read-progress', blob);
|
||||||
|
if (!ok) throw new Error('sendBeacon rejected');
|
||||||
|
} catch {
|
||||||
try {
|
try {
|
||||||
void fetch('/api/v1/me/read-progress', {
|
void fetch('/api/v1/me/read-progress', {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
@@ -377,21 +383,21 @@
|
|||||||
credentials: 'include'
|
credentials: 'include'
|
||||||
});
|
});
|
||||||
} catch {
|
} catch {
|
||||||
// keepalive fetch was rejected (very old Firefox etc.);
|
// Final fallback failed; the in-app onDestroy flush
|
||||||
// the in-app onDestroy flush below catches the SPA-
|
// below catches the SPA-navigation case.
|
||||||
// navigation case, which is the common one anyway.
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
window.addEventListener('pagehide', flushFinalProgress);
|
window.addEventListener('pagehide', beaconFinalProgress);
|
||||||
});
|
});
|
||||||
|
|
||||||
onDestroy(() => {
|
onDestroy(() => {
|
||||||
observer?.disconnect();
|
observer?.disconnect();
|
||||||
if (progressTimer) clearTimeout(progressTimer);
|
if (progressTimer) clearTimeout(progressTimer);
|
||||||
if (typeof window !== 'undefined') {
|
if (typeof window !== 'undefined') {
|
||||||
window.removeEventListener('pagehide', flushFinalProgress);
|
window.removeEventListener('pagehide', beaconFinalProgress);
|
||||||
}
|
}
|
||||||
// Don't let the fullscreen flag leak to non-reader pages —
|
// Don't let the fullscreen flag leak to non-reader pages —
|
||||||
// otherwise the layout header would stay slid-off on /upload
|
// otherwise the layout header would stay slid-off on /upload
|
||||||
|
|||||||
Reference in New Issue
Block a user