Skip to content

Instantly share code, notes, and snippets.

@vcapra1
vcapra1 / keybase.md
Created July 19, 2019 23:24
keybase.md

Keybase proof

I hereby claim:

  • I am vcapra1 on github.
  • I am vcapra1 (https://keybase.io/vcapra1) on keybase.
  • I have a public key ASAJP73lWD9DcDeyhAps5qUPp_m3B8ju9Tss8c1iOeSoIwo

To claim this, I am signing this object:

@vcapra1
vcapra1 / hosts.rs
Created May 12, 2019 19:37
Rocket.rs route by subdomain
use rocket::{request::FromRequest, Outcome, Request};
pub struct WWWHost;
pub struct AAAHost;
impl<'a, 'r> FromRequest<'a, 'r> for WWWHost {
type Error = ();
fn from_request(request: &'a Request<'r>) -> rocket::request::Outcome<Self, Self::Error> {
if let Some(hostname) = request.headers().get_one("host") {
@vcapra1
vcapra1 / Cargo.toml
Last active January 25, 2019 16:45
Files for SO Q#54369113
[package]
name = "my-app"
version = "0.1.0"
authors = ["vinnie <vcapra1@gmail.com>"]
edition = "2018"
[dependencies]
rocket = "0.4.0"