Simplify proxy

This commit is contained in:
spikecodes 2021-01-25 17:01:02 -08:00
parent e6c2d08425
commit f72c9d39be
1 changed files with 3 additions and 3 deletions

View File

@ -21,10 +21,10 @@ pub async fn handler(web::Path(b64): web::Path<String>) -> Result<HttpResponse>
"v.redd.it",
];
match decode(b64) {
Ok(bytes) => {
let media = String::from_utf8(bytes).unwrap_or_default();
let decoded = decode(b64).map(|bytes| String::from_utf8(bytes).unwrap_or_default());
match decoded {
Ok(media) => {
match Url::parse(media.as_str()) {
Ok(url) => {
let domain = url.domain().unwrap_or_default();