Skip to content

Commit

Permalink
Cleanup, imports
Browse files Browse the repository at this point in the history
  • Loading branch information
joepio committed Feb 25, 2023
1 parent a6e2658 commit 32856aa
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 30 deletions.
49 changes: 40 additions & 9 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion server/src/bin.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use atomic_lib::{urls, Storelike};
use atomic_lib::{atomic_url::Routes, Storelike};
use atomic_server_lib::config::Opts;
use std::{fs::File, io::Write};

Expand Down
4 changes: 2 additions & 2 deletions server/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ pub struct Opts {
#[clap(value_enum, long, env = "ATOMIC_TRACING", default_value = "stdout")]
pub trace: Tracing,

/// Add this if you want so send e-mails (e.g. on user registration)
/// Host address of an SMTP server. Add if you want so send e-mails (e.g. for user registration). Also set the port.
#[clap(long, env = "ATOMIC_SMTP_HOST")]
pub smpt_host: Option<String>,

/// Useful for debugging e-mails during development, or if your SMTP server has an unconventional port number.
/// Port of your SMTP server.
#[clap(long, env = "ATOMIC_SMTP_PORT", default_value = "25")]
pub smpt_port: u16,

Expand Down
18 changes: 0 additions & 18 deletions server/src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,24 +160,6 @@ pub fn get_client_agent(
Ok(Some(for_agent))
}

/// Finds the extension
pub fn try_extension(path: &str) -> Option<(ContentType, &str)> {
let items: Vec<&str> = path.split('.').collect();
if items.len() == 2 {
let path = items[0];
let content_type = match items[1] {
"json" => ContentType::Json,
"jsonld" => ContentType::JsonLd,
"jsonad" => ContentType::JsonAd,
"html" => ContentType::Html,
"ttl" => ContentType::Turtle,
_ => return None,
};
return Some((content_type, path));
}
None
}

fn session_cookies_from_header(header: &HeaderValue) -> AtomicServerResult<Vec<String>> {
let cookies: Vec<&str> = header
.to_str()
Expand Down

0 comments on commit 32856aa

Please sign in to comment.