mirror of
https://github.com/redlib-org/redlib.git
synced 2024-12-06 19:27:17 +01:00
Change the bypass message and format code
The bypass message now indicates that the bypass is only temporary.
This commit is contained in:
+5
-5
@@ -895,13 +895,13 @@ pub fn sfw_only() -> bool {
|
||||
|
||||
// Determines if a request shoud redirect to a nsfw landing gate.
|
||||
pub fn should_be_nsfw_gated(req: &Request<Body>, req_url: &String) -> bool {
|
||||
let sfw_instance = sfw_only();
|
||||
let gate_nsfw = (setting(&req, "show_nsfw") != "on") || sfw_instance;
|
||||
let sfw_instance = sfw_only();
|
||||
let gate_nsfw = (setting(&req, "show_nsfw") != "on") || sfw_instance;
|
||||
|
||||
// Nsfw landing gate should not be bypassed on a sfw only instance,
|
||||
let bypass_gate = !sfw_instance && req_url.ends_with("&bypass_nsfw_landing");
|
||||
// Nsfw landing gate should not be bypassed on a sfw only instance,
|
||||
let bypass_gate = !sfw_instance && req_url.ends_with("&bypass_nsfw_landing");
|
||||
|
||||
gate_nsfw && !bypass_gate
|
||||
gate_nsfw && !bypass_gate
|
||||
}
|
||||
|
||||
/// Renders the landing page for NSFW content when the user has not enabled
|
||||
|
||||
Reference in New Issue
Block a user