Skip to content

Commit 2d0c25c

Browse files
committed
Fix rebase issues
1 parent 1e89513 commit 2d0c25c

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
@@ -271,3 +271,21 @@ pub fn get_subject(
271271
let subject = format!("{}{}", server_without_last_slash, &req.uri().to_string());
272272
Ok(subject)
273273
}
274+
275+
/// Finds the extension
276+
pub fn try_extension(path: &str) -> Option<(ContentType, &str)> {
277+
let items: Vec<&str> = path.split('.').collect();
278+
if items.len() == 2 {
279+
let path = items[0];
280+
let content_type = match items[1] {
281+
"json" => ContentType::Json,
282+
"jsonld" => ContentType::JsonLd,
283+
"jsonad" => ContentType::JsonAd,
284+
"html" => ContentType::Html,
285+
"ttl" => ContentType::Turtle,
286+
_ => return None,
287+
};
288+
return Some((content_type, path));
289+
}
290+
None
291+
}

0 commit comments

Comments
 (0)