diff --git a/index.md b/index.md deleted file mode 100644 index c483de7..0000000 --- a/index.md +++ /dev/null @@ -1,24 +0,0 @@ -# Obscuritus - -Hello! - -I hope you're not looking for anything too cool here - as this is mostly my musing regarding RPGs, Sysadminning, or homegames. The more I end up doing, the happier I'll be - at some point I'll do more of this. - -If you're looking for old issues of the [Obscuritus](RPGs/Obscuritus_Mag.html) magazine I printed for my ancient Dresden Files game - I still have them, at that link. - -If you're looking for things I've made for print: -I've currently got nothing to put out - hopefully will change - -If you're interested - my [h-card](https://indieweb.org/h-card) is: -
-
-
- http://obscuritus.ca
-
-
- silverwizard@obscuritus.ca
-
- xmpp:silverwizard@obscuritus.ca
-
- http://convenient.email/profile/silverwizard?tab=profile
-
Not Found
"; - let mut page; let mut status_line = "HTTP/1.1 404 NOT FOUND"; let end = request_line.len()-9; let keyword = &request_line[0..3]; - let path = &request_line[5..end]; + let mut path = &request_line[5..end]; let version = &request_line[(end+1)..request_line.len()]; - println!("Line length: {}{}{}", keyword, path, version); + let page: rust_embed::EmbeddedFile; if keyword == "GET" { - if version == "HTTP/1.1" { - if path == "index.html" || path == "" { - status_line = "HTTP/1.1 200 OK"; - page = Asset::get("index.html").unwrap(); - content = std::str::from_utf8(page.data.as_ref()).unwrap(); - }else if path == "style.css" { + if version == "HTTP/1.1" || version == "HTTP/2.0" || version == "HTTP/1.0" { + if path == "" { + path = "index.html"; + } + if Asset::iter().any(|x| x.as_ref().eq(path)) { + page = Asset::get(path).unwrap(); status_line = "HTTP/1.1 200 OK"; - page = Asset::get("style.css").unwrap(); content = std::str::from_utf8(page.data.as_ref()).unwrap(); } + }else{ + status_line = "HTTP/1.1 505 NOT IMPLEMENTED"; + content = "Error 505HTTP Version Not Supported
"; } + }else{ + status_line = "HTTP/1.1 501 Not Implemented"; + content = "Error 501Not Implemented
"; } - let status_line = "HTTP/1.1 200 OK"; let length = content.len(); let response = format!( "{}\r\nContent-Length: {}\r\n\r\n{}"