Skip to content

Commit 50aba70

Browse files
committed
Fix rebase issues
1 parent 09a58e7 commit 50aba70

File tree

2 files changed

+18
-130
lines changed

2 files changed

+18
-130
lines changed

lib/src/plugins/reset_pubkey.rs

Lines changed: 0 additions & 130 deletions
This file was deleted.

server/src/helpers.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,3 +307,21 @@ pub fn get_subject(
307307
let subject = format!("{}{}", server_without_last_slash, &req.uri().to_string());
308308
Ok(subject)
309309
}
310+
311+
/// Finds the extension
312+
pub fn try_extension(path: &str) -> Option<(ContentType, &str)> {
313+
let items: Vec<&str> = path.split('.').collect();
314+
if items.len() == 2 {
315+
let path = items[0];
316+
let content_type = match items[1] {
317+
"json" => ContentType::Json,
318+
"jsonld" => ContentType::JsonLd,
319+
"jsonad" => ContentType::JsonAd,
320+
"html" => ContentType::Html,
321+
"ttl" => ContentType::Turtle,
322+
_ => return None,
323+
};
324+
return Some((content_type, path));
325+
}
326+
None
327+
}

0 commit comments

Comments
 (0)