2020-01-17 14:27:28 +01:00
|
|
|
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
|
2019-01-07 11:33:07 +01:00
|
|
|
// This file is part of Parity Ethereum.
|
2016-12-11 19:15:58 +01:00
|
|
|
|
2019-01-07 11:33:07 +01:00
|
|
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
2016-12-11 19:15:58 +01:00
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
|
2019-01-07 11:33:07 +01:00
|
|
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
2016-12-11 19:15:58 +01:00
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
|
|
|
// You should have received a copy of the GNU General Public License
|
2019-01-07 11:33:07 +01:00
|
|
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
2016-12-11 19:15:58 +01:00
|
|
|
|
|
|
|
//! URLHint Contract
|
|
|
|
|
2019-10-03 15:15:25 +02:00
|
|
|
use std::sync::Weak;
|
2017-07-06 11:26:14 +02:00
|
|
|
use rustc_hex::ToHex;
|
2017-10-05 12:35:01 +02:00
|
|
|
use mime::{self, Mime};
|
2016-12-11 19:15:58 +01:00
|
|
|
use mime_guess;
|
|
|
|
|
2018-02-09 09:32:06 +01:00
|
|
|
use ethereum_types::{H256, Address};
|
2019-10-03 15:15:25 +02:00
|
|
|
use registrar::RegistrarClient;
|
|
|
|
use types::ids::BlockId;
|
2016-12-11 19:15:58 +01:00
|
|
|
|
2018-09-13 11:04:39 +02:00
|
|
|
use_contract!(urlhint, "res/urlhint.json");
|
2017-10-05 12:35:01 +02:00
|
|
|
|
2016-12-11 19:15:58 +01:00
|
|
|
const COMMIT_LEN: usize = 20;
|
2018-03-12 21:46:27 +01:00
|
|
|
const GITHUB_HINT: &'static str = "githubhint";
|
2017-12-13 07:56:35 +01:00
|
|
|
/// GithubHint entries with commit set as `0x0..01` should be treated
|
|
|
|
/// as Github Dapp, downloadable zip files, than can be extracted, containing
|
|
|
|
/// the manifest.json file along with the dapp
|
|
|
|
static GITHUB_DAPP_COMMIT: &[u8; COMMIT_LEN] = &[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1];
|
2016-12-11 19:15:58 +01:00
|
|
|
|
|
|
|
/// Github-hosted dapp.
|
|
|
|
#[derive(Debug, PartialEq)]
|
|
|
|
pub struct GithubApp {
|
|
|
|
/// Github Account
|
|
|
|
pub account: String,
|
|
|
|
/// Github Repository
|
|
|
|
pub repo: String,
|
|
|
|
/// Commit on Github
|
2017-05-18 12:44:09 +02:00
|
|
|
pub commit: [u8; COMMIT_LEN],
|
2016-12-11 19:15:58 +01:00
|
|
|
/// Dapp owner address
|
|
|
|
pub owner: Address,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl GithubApp {
|
|
|
|
/// Returns URL of this Github-hosted dapp package.
|
|
|
|
pub fn url(&self) -> String {
|
|
|
|
// Since https fetcher doesn't support redirections we use direct link
|
|
|
|
// format!("https://github.com/{}/{}/archive/{}.zip", self.account, self.repo, self.commit.to_hex())
|
|
|
|
format!("https://codeload.github.com/{}/{}/zip/{}", self.account, self.repo, self.commit.to_hex())
|
|
|
|
}
|
|
|
|
|
|
|
|
fn commit(bytes: &[u8]) -> Option<[u8;COMMIT_LEN]> {
|
|
|
|
if bytes.len() < COMMIT_LEN {
|
|
|
|
return None;
|
|
|
|
}
|
|
|
|
|
|
|
|
let mut commit = [0; COMMIT_LEN];
|
|
|
|
for i in 0..COMMIT_LEN {
|
|
|
|
commit[i] = bytes[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
Some(commit)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Hash-Addressed Content
|
|
|
|
#[derive(Debug, PartialEq)]
|
|
|
|
pub struct Content {
|
|
|
|
/// URL of the content
|
|
|
|
pub url: String,
|
|
|
|
/// MIME type of the content
|
2016-12-22 18:26:39 +01:00
|
|
|
pub mime: Mime,
|
2016-12-11 19:15:58 +01:00
|
|
|
/// Content owner address
|
|
|
|
pub owner: Address,
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Result of resolving id to URL
|
|
|
|
#[derive(Debug, PartialEq)]
|
|
|
|
pub enum URLHintResult {
|
|
|
|
/// Dapp
|
|
|
|
Dapp(GithubApp),
|
2017-12-13 07:56:35 +01:00
|
|
|
/// GithubDapp
|
|
|
|
GithubDapp(Content),
|
2016-12-11 19:15:58 +01:00
|
|
|
/// Content
|
|
|
|
Content(Content),
|
|
|
|
}
|
|
|
|
|
|
|
|
/// URLHint Contract interface
|
2017-04-03 10:27:37 +02:00
|
|
|
pub trait URLHint: Send + Sync {
|
2016-12-11 19:15:58 +01:00
|
|
|
/// Resolves given id to registrar entry.
|
2019-10-03 15:15:25 +02:00
|
|
|
fn resolve(&self, id: H256) -> Result<Option<URLHintResult>, String>;
|
2016-12-11 19:15:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/// `URLHintContract` API
|
|
|
|
pub struct URLHintContract {
|
2019-10-03 15:15:25 +02:00
|
|
|
client: Weak<dyn RegistrarClient>,
|
2016-12-11 19:15:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
impl URLHintContract {
|
|
|
|
/// Creates new `URLHintContract`
|
2019-10-03 15:15:25 +02:00
|
|
|
pub fn new(client: Weak<dyn RegistrarClient>) -> Self {
|
2016-12-11 19:15:58 +01:00
|
|
|
URLHintContract {
|
2018-03-12 21:46:27 +01:00
|
|
|
client: client,
|
2016-12-11 19:15:58 +01:00
|
|
|
}
|
|
|
|
}
|
2017-05-18 12:44:09 +02:00
|
|
|
}
|
2016-12-11 19:15:58 +01:00
|
|
|
|
2017-12-13 07:56:35 +01:00
|
|
|
fn get_urlhint_content(account_slash_repo: String, owner: Address) -> Content {
|
|
|
|
let mime = guess_mime_type(&account_slash_repo).unwrap_or(mime::APPLICATION_JSON);
|
|
|
|
Content {
|
|
|
|
url: account_slash_repo,
|
|
|
|
mime,
|
|
|
|
owner,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-03 15:15:25 +02:00
|
|
|
fn decode_urlhint_output(
|
|
|
|
account_slash_repo: String,
|
|
|
|
commit: [u8; 20],
|
|
|
|
owner: Address
|
|
|
|
) -> Option<URLHintResult> {
|
2019-06-03 15:36:21 +02:00
|
|
|
if owner == Address::zero() {
|
2017-05-18 12:44:09 +02:00
|
|
|
return None;
|
2016-12-11 19:15:58 +01:00
|
|
|
}
|
|
|
|
|
2017-05-18 12:44:09 +02:00
|
|
|
let commit = GithubApp::commit(&commit);
|
2017-12-13 07:56:35 +01:00
|
|
|
|
2017-05-18 12:44:09 +02:00
|
|
|
if commit == Some(Default::default()) {
|
2017-12-13 07:56:35 +01:00
|
|
|
let content = get_urlhint_content(account_slash_repo, owner);
|
|
|
|
return Some(URLHintResult::Content(content));
|
|
|
|
}
|
|
|
|
|
|
|
|
if commit == Some(*GITHUB_DAPP_COMMIT) {
|
|
|
|
let content = get_urlhint_content(account_slash_repo, owner);
|
|
|
|
return Some(URLHintResult::GithubDapp(content));
|
2016-12-11 19:15:58 +01:00
|
|
|
}
|
|
|
|
|
2017-05-18 12:44:09 +02:00
|
|
|
let (account, repo) = {
|
|
|
|
let mut it = account_slash_repo.split('/');
|
|
|
|
match (it.next(), it.next()) {
|
|
|
|
(Some(account), Some(repo)) => (account.into(), repo.into()),
|
|
|
|
_ => return None,
|
2016-12-11 19:15:58 +01:00
|
|
|
}
|
2017-05-18 12:44:09 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
commit.map(|commit| URLHintResult::Dapp(GithubApp {
|
|
|
|
account: account,
|
|
|
|
repo: repo,
|
|
|
|
commit: commit,
|
|
|
|
owner: owner,
|
|
|
|
}))
|
2016-12-11 19:15:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
impl URLHint for URLHintContract {
|
2019-10-03 15:15:25 +02:00
|
|
|
fn resolve(&self, id: H256) -> Result<Option<URLHintResult>, String> {
|
|
|
|
use urlhint::urlhint::functions::entries::{encode_input, decode_output};
|
|
|
|
|
|
|
|
let client = self.client.clone().upgrade()
|
|
|
|
.ok_or_else(|| "Registrar/contract client unavailable".to_owned())?;
|
|
|
|
|
|
|
|
let returned_address = client.get_address(GITHUB_HINT, BlockId::Latest)?;
|
|
|
|
|
|
|
|
if let Some(address) = returned_address {
|
|
|
|
let data = encode_input(id);
|
|
|
|
let output_bytes = client.call_contract(BlockId::Latest, address, data)?;
|
|
|
|
let (account_slash_repo, commit, owner) = decode_output(&output_bytes)
|
|
|
|
.map_err(|e| e.to_string())?;
|
|
|
|
|
|
|
|
let url_hint = decode_urlhint_output(account_slash_repo, commit, owner);
|
|
|
|
|
|
|
|
Ok(url_hint)
|
|
|
|
} else {
|
|
|
|
Ok(None)
|
|
|
|
}
|
2016-12-11 19:15:58 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-12-22 18:26:39 +01:00
|
|
|
fn guess_mime_type(url: &str) -> Option<Mime> {
|
2016-12-11 19:15:58 +01:00
|
|
|
const CONTENT_TYPE: &'static str = "content-type=";
|
|
|
|
|
|
|
|
let mut it = url.split('#');
|
|
|
|
// skip url
|
|
|
|
let url = it.next();
|
|
|
|
// get meta headers
|
|
|
|
let metas = it.next();
|
|
|
|
if let Some(metas) = metas {
|
|
|
|
for meta in metas.split('&') {
|
|
|
|
let meta = meta.to_lowercase();
|
|
|
|
if meta.starts_with(CONTENT_TYPE) {
|
2016-12-22 18:26:39 +01:00
|
|
|
return meta[CONTENT_TYPE.len()..].parse().ok();
|
2016-12-11 19:15:58 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
url.and_then(|url| {
|
|
|
|
url.split('.').last()
|
|
|
|
}).and_then(|extension| {
|
2016-12-22 18:26:39 +01:00
|
|
|
mime_guess::get_mime_type_opt(extension)
|
2016-12-11 19:15:58 +01:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
#[cfg(test)]
|
2017-02-20 16:30:14 +01:00
|
|
|
pub mod tests {
|
2016-12-11 19:15:58 +01:00
|
|
|
use std::sync::Arc;
|
|
|
|
use std::str::FromStr;
|
2017-07-06 11:26:14 +02:00
|
|
|
use rustc_hex::FromHex;
|
2016-12-11 19:15:58 +01:00
|
|
|
|
|
|
|
use super::*;
|
|
|
|
use super::guess_mime_type;
|
2017-09-02 20:09:13 +02:00
|
|
|
use parking_lot::Mutex;
|
2018-01-10 13:35:18 +01:00
|
|
|
use ethereum_types::Address;
|
2017-09-06 20:47:45 +02:00
|
|
|
use bytes::{Bytes, ToPretty};
|
2019-10-03 15:15:25 +02:00
|
|
|
use call_contract::CallContract;
|
2016-12-11 19:15:58 +01:00
|
|
|
|
2017-02-20 16:30:14 +01:00
|
|
|
pub struct FakeRegistrar {
|
2016-12-11 19:15:58 +01:00
|
|
|
pub calls: Arc<Mutex<Vec<(String, String)>>>,
|
|
|
|
pub responses: Mutex<Vec<Result<Bytes, String>>>,
|
|
|
|
}
|
|
|
|
|
2017-02-20 16:30:14 +01:00
|
|
|
pub const REGISTRAR: &'static str = "8e4e9b13d4b45cb0befc93c3061b1408f67316b2";
|
|
|
|
pub const URLHINT: &'static str = "deadbeefcafe0000000000000000000000000000";
|
2016-12-11 19:15:58 +01:00
|
|
|
|
|
|
|
impl FakeRegistrar {
|
2017-02-20 16:30:14 +01:00
|
|
|
pub fn new() -> Self {
|
2016-12-11 19:15:58 +01:00
|
|
|
FakeRegistrar {
|
|
|
|
calls: Arc::new(Mutex::new(Vec::new())),
|
|
|
|
responses: Mutex::new(
|
|
|
|
vec![
|
|
|
|
Ok(format!("000000000000000000000000{}", URLHINT).from_hex().unwrap()),
|
|
|
|
Ok(Vec::new())
|
|
|
|
]
|
|
|
|
),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-03 15:15:25 +02:00
|
|
|
impl CallContract for FakeRegistrar {
|
|
|
|
fn call_contract(
|
|
|
|
&self,
|
|
|
|
_block: BlockId,
|
|
|
|
address: Address,
|
|
|
|
data: Bytes
|
|
|
|
) -> Result<Bytes, String> {
|
|
|
|
self.calls.lock().push((address.to_hex(), data.to_hex()));
|
|
|
|
let res = self.responses.lock().remove(0);
|
2018-03-12 21:46:27 +01:00
|
|
|
|
2019-10-03 15:15:25 +02:00
|
|
|
res
|
2016-12-11 19:15:58 +01:00
|
|
|
}
|
2019-10-03 15:15:25 +02:00
|
|
|
}
|
2016-12-11 19:15:58 +01:00
|
|
|
|
2019-10-03 15:15:25 +02:00
|
|
|
impl RegistrarClient for FakeRegistrar {
|
|
|
|
fn registrar_address(&self) -> Option<Address> {
|
|
|
|
Some(REGISTRAR.parse().unwrap())
|
2016-12-11 19:15:58 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-03 15:36:21 +02:00
|
|
|
fn h256_from_short_str(s: &str) -> H256 {
|
|
|
|
let mut bytes = s.as_bytes().to_vec();
|
|
|
|
bytes.resize(32usize, 0u8);
|
|
|
|
H256::from_slice(bytes.as_ref())
|
|
|
|
}
|
|
|
|
|
2016-12-11 19:15:58 +01:00
|
|
|
#[test]
|
|
|
|
fn should_call_registrar_and_urlhint_contracts() {
|
|
|
|
// given
|
|
|
|
let registrar = FakeRegistrar::new();
|
2017-05-18 12:44:09 +02:00
|
|
|
let resolve_result = {
|
2017-10-16 10:21:35 +02:00
|
|
|
use ethabi::{encode, Token};
|
2018-02-09 09:32:06 +01:00
|
|
|
encode(&[Token::String(String::new()), Token::FixedBytes(vec![0; 20]), Token::Address([0; 20].into())])
|
2017-05-18 12:44:09 +02:00
|
|
|
};
|
|
|
|
registrar.responses.lock()[1] = Ok(resolve_result);
|
|
|
|
|
2016-12-11 19:15:58 +01:00
|
|
|
let calls = registrar.calls.clone();
|
2019-10-03 15:15:25 +02:00
|
|
|
|
|
|
|
let registrar = Arc::new(registrar) as Arc<dyn RegistrarClient>;
|
|
|
|
let urlhint = URLHintContract::new(Arc::downgrade(®istrar));
|
2016-12-11 19:15:58 +01:00
|
|
|
|
|
|
|
// when
|
2019-10-03 15:15:25 +02:00
|
|
|
let res = urlhint.resolve(h256_from_short_str("test")).unwrap();
|
2016-12-11 19:15:58 +01:00
|
|
|
let calls = calls.lock();
|
|
|
|
let call0 = calls.get(0).expect("Registrar resolve called");
|
|
|
|
let call1 = calls.get(1).expect("URLHint Resolve called");
|
|
|
|
|
|
|
|
// then
|
|
|
|
assert!(res.is_none());
|
|
|
|
assert_eq!(call0.0, REGISTRAR);
|
|
|
|
assert_eq!(call0.1,
|
|
|
|
"6795dbcd058740ee9a5a3fb9f1cfa10752baec87e09cc45cd7027fd54708271aca300c75000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000014100000000000000000000000000000000000000000000000000000000000000".to_owned()
|
|
|
|
);
|
|
|
|
assert_eq!(call1.0, URLHINT);
|
|
|
|
assert_eq!(call1.1,
|
|
|
|
"267b69227465737400000000000000000000000000000000000000000000000000000000".to_owned()
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn should_decode_urlhint_output() {
|
|
|
|
// given
|
|
|
|
let mut registrar = FakeRegistrar::new();
|
|
|
|
registrar.responses = Mutex::new(vec![
|
|
|
|
Ok(format!("000000000000000000000000{}", URLHINT).from_hex().unwrap()),
|
|
|
|
Ok("0000000000000000000000000000000000000000000000000000000000000060ec4c1fe06c808fe3739858c347109b1f5f1ed4b5000000000000000000000000000000000000000000000000deadcafebeefbeefcafedeaddeedfeedffffffff0000000000000000000000000000000000000000000000000000000000000011657468636f72652f64616f2e636c61696d000000000000000000000000000000".from_hex().unwrap()),
|
|
|
|
]);
|
2019-10-03 15:15:25 +02:00
|
|
|
|
|
|
|
let registrar = Arc::new(registrar) as Arc<dyn RegistrarClient>;
|
|
|
|
let urlhint = URLHintContract::new(Arc::downgrade(®istrar));
|
2016-12-11 19:15:58 +01:00
|
|
|
|
|
|
|
// when
|
2019-10-03 15:15:25 +02:00
|
|
|
let res = urlhint.resolve(h256_from_short_str("test")).unwrap();
|
2016-12-11 19:15:58 +01:00
|
|
|
|
|
|
|
// then
|
|
|
|
assert_eq!(res, Some(URLHintResult::Dapp(GithubApp {
|
|
|
|
account: "ethcore".into(),
|
|
|
|
repo: "dao.claim".into(),
|
|
|
|
commit: GithubApp::commit(&"ec4c1fe06c808fe3739858c347109b1f5f1ed4b5".from_hex().unwrap()).unwrap(),
|
|
|
|
owner: Address::from_str("deadcafebeefbeefcafedeaddeedfeedffffffff").unwrap(),
|
|
|
|
})))
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn should_decode_urlhint_content_output() {
|
|
|
|
// given
|
|
|
|
let mut registrar = FakeRegistrar::new();
|
|
|
|
registrar.responses = Mutex::new(vec![
|
|
|
|
Ok(format!("000000000000000000000000{}", URLHINT).from_hex().unwrap()),
|
2017-05-18 12:44:09 +02:00
|
|
|
Ok("00000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000deadcafebeefbeefcafedeaddeedfeedffffffff000000000000000000000000000000000000000000000000000000000000003c68747470733a2f2f7061726974792e696f2f6173736574732f696d616765732f657468636f72652d626c61636b2d686f72697a6f6e74616c2e706e6700000000".from_hex().unwrap()),
|
2016-12-11 19:15:58 +01:00
|
|
|
]);
|
2019-10-03 15:15:25 +02:00
|
|
|
|
|
|
|
let registrar = Arc::new(registrar) as Arc<dyn RegistrarClient>;
|
|
|
|
let urlhint = URLHintContract::new(Arc::downgrade(®istrar));
|
2016-12-11 19:15:58 +01:00
|
|
|
|
|
|
|
// when
|
2019-10-03 15:15:25 +02:00
|
|
|
let res = urlhint.resolve(h256_from_short_str("test")).unwrap();
|
2016-12-11 19:15:58 +01:00
|
|
|
|
|
|
|
// then
|
|
|
|
assert_eq!(res, Some(URLHintResult::Content(Content {
|
2017-05-02 11:41:09 +02:00
|
|
|
url: "https://parity.io/assets/images/ethcore-black-horizontal.png".into(),
|
2017-10-05 12:35:01 +02:00
|
|
|
mime: mime::IMAGE_PNG,
|
2016-12-11 19:15:58 +01:00
|
|
|
owner: Address::from_str("deadcafebeefbeefcafedeaddeedfeedffffffff").unwrap(),
|
|
|
|
})))
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn should_return_valid_url() {
|
|
|
|
// given
|
|
|
|
let app = GithubApp {
|
|
|
|
account: "test".into(),
|
|
|
|
repo: "xyz".into(),
|
|
|
|
commit: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19],
|
2019-06-03 15:36:21 +02:00
|
|
|
owner: Address::zero(),
|
2016-12-11 19:15:58 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
// when
|
|
|
|
let url = app.url();
|
|
|
|
|
|
|
|
// then
|
|
|
|
assert_eq!(url, "https://codeload.github.com/test/xyz/zip/000102030405060708090a0b0c0d0e0f10111213".to_owned());
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn should_guess_mime_type_from_url() {
|
2017-05-02 11:41:09 +02:00
|
|
|
let url1 = "https://parity.io/parity";
|
|
|
|
let url2 = "https://parity.io/parity#content-type=image/png";
|
|
|
|
let url3 = "https://parity.io/parity#something&content-type=image/png";
|
|
|
|
let url4 = "https://parity.io/parity.png#content-type=image/jpeg";
|
|
|
|
let url5 = "https://parity.io/parity.png";
|
2016-12-11 19:15:58 +01:00
|
|
|
|
|
|
|
assert_eq!(guess_mime_type(url1), None);
|
2017-10-05 12:35:01 +02:00
|
|
|
assert_eq!(guess_mime_type(url2), Some(mime::IMAGE_PNG));
|
|
|
|
assert_eq!(guess_mime_type(url3), Some(mime::IMAGE_PNG));
|
|
|
|
assert_eq!(guess_mime_type(url4), Some(mime::IMAGE_JPEG));
|
|
|
|
assert_eq!(guess_mime_type(url5), Some(mime::IMAGE_PNG));
|
2016-12-11 19:15:58 +01:00
|
|
|
}
|
|
|
|
}
|